diff --git a/go.mod b/go.mod index db15dbd7f7..2993d125d5 100644 --- a/go.mod +++ b/go.mod @@ -8,25 +8,25 @@ replace github.com/GoogleCloudPlatform/k8s-config-connector/mockgcp => ./mockgcp require ( cloud.google.com/go/apikeys v1.1.12 - cloud.google.com/go/bigquery v1.63.1 - cloud.google.com/go/certificatemanager v1.9.1 - cloud.google.com/go/cloudbuild v1.18.0 - cloud.google.com/go/compute v1.28.1 - cloud.google.com/go/dataflow v0.10.1 - cloud.google.com/go/dataform v0.10.1 + cloud.google.com/go/bigquery v1.65.0 + cloud.google.com/go/certificatemanager v1.9.2 + cloud.google.com/go/cloudbuild v1.19.0 + cloud.google.com/go/compute v1.29.0 + cloud.google.com/go/dataflow v0.10.2 + cloud.google.com/go/dataform v0.10.2 cloud.google.com/go/discoveryengine v1.15.0 cloud.google.com/go/firestore v1.17.0 - cloud.google.com/go/gkemulticloud v1.4.0 - cloud.google.com/go/iam v1.2.1 - cloud.google.com/go/kms v1.20.0 - cloud.google.com/go/monitoring v1.21.1 + cloud.google.com/go/gkemulticloud v1.4.1 + cloud.google.com/go/iam v1.2.2 + cloud.google.com/go/kms v1.20.1 + cloud.google.com/go/monitoring v1.21.2 cloud.google.com/go/privilegedaccessmanager v0.2.1 cloud.google.com/go/profiler v0.4.1 - cloud.google.com/go/redis v1.17.1 - cloud.google.com/go/resourcemanager v1.10.1 - cloud.google.com/go/secretmanager v1.14.1 + cloud.google.com/go/redis v1.17.2 + cloud.google.com/go/resourcemanager v1.10.2 + cloud.google.com/go/secretmanager v1.14.2 cloud.google.com/go/securesourcemanager v1.1.1 - cloud.google.com/go/security v1.18.1 + cloud.google.com/go/security v1.18.2 cloud.google.com/go/workstations v1.1.1 contrib.go.opencensus.io/exporter/prometheus v0.1.0 github.com/GoogleCloudPlatform/declarative-resource-client-library v1.62.0 @@ -41,7 +41,7 @@ require ( github.com/go-logr/zapr v1.3.0 github.com/google/go-cmp v0.6.0 github.com/google/uuid v1.6.0 - github.com/googleapis/gax-go/v2 v2.13.0 + github.com/googleapis/gax-go/v2 v2.14.0 github.com/gosimple/slug v1.13.1 github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 github.com/hashicorp/go-multierror v1.1.1 @@ -64,15 +64,15 @@ require ( github.com/zclconf/go-cty v1.13.0 go.opencensus.io v0.24.0 go.uber.org/zap v1.26.0 - golang.org/x/oauth2 v0.23.0 - golang.org/x/sync v0.8.0 - golang.org/x/time v0.7.0 - google.golang.org/api v0.203.0 - google.golang.org/genproto v0.0.0-20241015192408-796eee8c2d53 - google.golang.org/genproto/googleapis/api v0.0.0-20241007155032-5fefd90f89a9 - google.golang.org/genproto/googleapis/rpc v0.0.0-20241015192408-796eee8c2d53 + golang.org/x/oauth2 v0.24.0 + golang.org/x/sync v0.9.0 + golang.org/x/time v0.8.0 + google.golang.org/api v0.210.0 + google.golang.org/genproto v0.0.0-20241118233622-e639e219e697 + google.golang.org/genproto/googleapis/api v0.0.0-20241113202542-65e8d215514f + google.golang.org/genproto/googleapis/rpc v0.0.0-20241118233622-e639e219e697 google.golang.org/grpc v1.67.1 - google.golang.org/protobuf v1.35.1 + google.golang.org/protobuf v1.35.2 gopkg.in/dnaeon/go-vcr.v3 v3.2.0 gopkg.in/yaml.v2 v2.4.0 k8s.io/api v0.27.11 @@ -92,17 +92,18 @@ require ( bitbucket.org/creachadair/stringset v0.0.8 // indirect cel.dev/expr v0.16.0 // indirect cloud.google.com/go v0.116.0 // indirect - cloud.google.com/go/auth v0.9.9 // indirect - cloud.google.com/go/auth/oauth2adapt v0.2.4 // indirect + cloud.google.com/go/auth v0.11.0 // indirect + cloud.google.com/go/auth/oauth2adapt v0.2.6 // indirect cloud.google.com/go/bigtable v1.33.0 // indirect cloud.google.com/go/compute/metadata v0.5.2 // indirect - cloud.google.com/go/longrunning v0.6.1 // indirect + cloud.google.com/go/longrunning v0.6.2 // indirect dario.cat/mergo v1.0.0 // indirect github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect github.com/MakeNowJust/heredoc v1.0.0 // indirect github.com/Microsoft/go-winio v0.6.1 // indirect github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 // indirect github.com/agext/levenshtein v1.2.3 // indirect + github.com/apache/arrow/go/v15 v15.0.2 // indirect github.com/apparentlymart/go-cidr v1.1.0 // indirect github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect @@ -136,11 +137,13 @@ require ( github.com/go-openapi/jsonreference v0.20.2 // indirect github.com/go-openapi/swag v0.22.3 // indirect github.com/gobuffalo/flect v0.2.3 // indirect + github.com/goccy/go-json v0.10.2 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/glog v1.2.2 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/protobuf v1.5.4 // indirect github.com/google/btree v1.1.3 // indirect + github.com/google/flatbuffers v23.5.26+incompatible // indirect github.com/google/gnostic v0.6.9 // indirect github.com/google/go-cpy v0.0.0-20211218193943-a9c933c06932 // indirect github.com/google/gofuzz v1.2.0 // indirect @@ -177,6 +180,8 @@ require ( github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/kevinburke/ssh_config v1.2.0 // indirect + github.com/klauspost/compress v1.16.7 // indirect + github.com/klauspost/cpuid/v2 v2.2.5 // indirect github.com/kylelemons/godebug v1.1.0 // indirect github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de // indirect github.com/mailru/easyjson v0.7.7 // indirect @@ -200,6 +205,7 @@ require ( github.com/oklog/run v1.0.0 // indirect github.com/onsi/ginkgo v1.16.5 // indirect github.com/peterbourgon/diskv v2.0.1+incompatible // indirect + github.com/pierrec/lz4/v4 v4.1.18 // indirect github.com/pjbgf/sha1cd v0.3.0 // indirect github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 // indirect github.com/prometheus/client_model v0.6.0 // indirect @@ -214,6 +220,7 @@ require ( github.com/vmihailenco/tagparser v0.1.2 // indirect github.com/xanzy/ssh-agent v0.3.3 // indirect github.com/xlab/treeprint v1.1.0 // indirect + github.com/zeebo/xxh3 v1.0.2 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.54.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.54.0 // indirect go.opentelemetry.io/otel v1.29.0 // indirect @@ -223,13 +230,15 @@ require ( go.opentelemetry.io/otel/trace v1.29.0 // indirect go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5 // indirect go.uber.org/multierr v1.10.0 // indirect - golang.org/x/crypto v0.28.0 // indirect + golang.org/x/crypto v0.29.0 // indirect + golang.org/x/exp v0.0.0-20231006140011-7918f672742d // indirect golang.org/x/mod v0.20.0 // indirect - golang.org/x/net v0.30.0 // indirect - golang.org/x/sys v0.26.0 // indirect - golang.org/x/term v0.25.0 // indirect - golang.org/x/text v0.19.0 // indirect + golang.org/x/net v0.31.0 // indirect + golang.org/x/sys v0.27.0 // indirect + golang.org/x/term v0.26.0 // indirect + golang.org/x/text v0.20.0 // indirect golang.org/x/tools v0.24.0 // indirect + golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da // indirect gomodules.xyz/jsonpatch/v2 v2.3.0 // indirect google.golang.org/appengine v1.6.8 // indirect gopkg.in/inf.v0 v0.9.1 // indirect diff --git a/go.sum b/go.sum index c715574541..97cebe7ecd 100644 --- a/go.sum +++ b/go.sum @@ -26,32 +26,34 @@ cloud.google.com/go v0.116.0 h1:B3fRrSDkLRt5qSHWe40ERJvhvnQwdZiHu0bJOpldweE= cloud.google.com/go v0.116.0/go.mod h1:cEPSRWPzZEswwdr9BxE6ChEn01dWlTaF05LiC2Xs70U= cloud.google.com/go/apikeys v1.1.12 h1:ZTFWJ1ibGjiIrIhhtdWOm7AGJd+y9R17dVujlgU//6E= cloud.google.com/go/apikeys v1.1.12/go.mod h1:3tqZUj8CmCJm0maQyLufgyO5Ghf3AZQ6hcSkIqsSIm4= -cloud.google.com/go/auth v0.9.9 h1:BmtbpNQozo8ZwW2t7QJjnrQtdganSdmqeIBxHxNkEZQ= -cloud.google.com/go/auth v0.9.9/go.mod h1:xxA5AqpDrvS+Gkmo9RqrGGRh6WSNKKOXhY3zNOr38tI= -cloud.google.com/go/auth/oauth2adapt v0.2.4 h1:0GWE/FUsXhf6C+jAkWgYm7X9tK8cuEIfy19DBn6B6bY= -cloud.google.com/go/auth/oauth2adapt v0.2.4/go.mod h1:jC/jOpwFP6JBxhB3P5Rr0a9HLMC/Pe3eaL4NmdvqPtc= +cloud.google.com/go/auth v0.11.0 h1:Ic5SZz2lsvbYcWT5dfjNWgw6tTlGi2Wc8hyQSC9BstA= +cloud.google.com/go/auth v0.11.0/go.mod h1:xxA5AqpDrvS+Gkmo9RqrGGRh6WSNKKOXhY3zNOr38tI= +cloud.google.com/go/auth/oauth2adapt v0.2.6 h1:V6a6XDu2lTwPZWOawrAa9HUK+DB2zfJyTuciBG5hFkU= +cloud.google.com/go/auth/oauth2adapt v0.2.6/go.mod h1:AlmsELtlEBnaNTL7jCj8VQFLy6mbZv0s4Q7NGBeQ5E8= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= -cloud.google.com/go/bigquery v1.63.1 h1:/6syiWrSpardKNxdvldS5CUTRJX1iIkSPXCjLjiGL+g= -cloud.google.com/go/bigquery v1.63.1/go.mod h1:ufaITfroCk17WTqBhMpi8CRjsfHjMX07pDrQaRKKX2o= +cloud.google.com/go/bigquery v1.65.0 h1:ZZ1EOJMHTYf6R9lhxIXZJic1qBD4/x9loBIS+82moUs= +cloud.google.com/go/bigquery v1.65.0/go.mod h1:9WXejQ9s5YkTW4ryDYzKXBooL78u5+akWGXgJqQkY6A= cloud.google.com/go/bigtable v1.33.0 h1:2BDaWLRAwXO14DJL/u8crbV2oUbMZkIa2eGq8Yao1bk= cloud.google.com/go/bigtable v1.33.0/go.mod h1:HtpnH4g25VT1pejHRtInlFPnN5sjTxbQlsYBjh9t5l0= -cloud.google.com/go/certificatemanager v1.9.1 h1:fULhIdwsz3SoZfiXw8XaxSJBpRTR0xwsJleO+wEbbKA= -cloud.google.com/go/certificatemanager v1.9.1/go.mod h1:a6bXZULtd6iQTRuSVs1fopcHLMJ/T3zSpIB7aJaq/js= -cloud.google.com/go/cloudbuild v1.18.0 h1:82f6g0AzacK1bbO0E5ZqixWc4nRzWu4ichIQ0QKNtAQ= -cloud.google.com/go/cloudbuild v1.18.0/go.mod h1:KCHWGIoS/5fj+By9YmgIQnUiDq8P6YURWOjX3hoc6As= -cloud.google.com/go/compute v1.28.1 h1:XwPcZjgMCnU2tkwY10VleUjSAfpTj9RDn+kGrbYsi8o= -cloud.google.com/go/compute v1.28.1/go.mod h1:b72iXMY4FucVry3NR3Li4kVyyTvbMDE7x5WsqvxjsYk= +cloud.google.com/go/certificatemanager v1.9.2 h1:/lO1ejN415kRaiO6DNNCHj0UvQujKP714q3l8gp4lsY= +cloud.google.com/go/certificatemanager v1.9.2/go.mod h1:PqW+fNSav5Xz8bvUnJpATIRo1aaABP4mUg/7XIeAn6c= +cloud.google.com/go/cloudbuild v1.19.0 h1:Uo0bL251yvyWsNtO3Og9m5Z4S48cgGf3IUX7xzOcl8s= +cloud.google.com/go/cloudbuild v1.19.0/go.mod h1:ZGRqbNMrVGhknIIjwASa6MqoRTOpXIVMSI+Ew5DMPuY= +cloud.google.com/go/compute v1.29.0 h1:Lph6d8oPi38NHkOr6S55Nus/Pbbcp37m/J0ohgKAefs= +cloud.google.com/go/compute v1.29.0/go.mod h1:HFlsDurE5DpQZClAGf/cYh+gxssMhBxBovZDYkEn/Og= cloud.google.com/go/compute/metadata v0.5.2 h1:UxK4uu/Tn+I3p2dYWTfiX4wva7aYlKixAHn3fyqngqo= cloud.google.com/go/compute/metadata v0.5.2/go.mod h1:C66sj2AluDcIqakBq/M8lw8/ybHgOZqin2obFxa/E5k= -cloud.google.com/go/dataflow v0.10.1 h1:RoVpCZ1BjJBH/5mzaXCgNg+l9FgTIYQ7C9xBRGvhkzo= -cloud.google.com/go/dataflow v0.10.1/go.mod h1:zP4/tNjONFRcS4NcI9R94YDQEkPalimdbPkijVNJt/g= -cloud.google.com/go/dataform v0.10.1 h1:FkOPrxf8sN9J2TMc4CIBhVivhMiO8D0eYN33s5A5Uo4= -cloud.google.com/go/dataform v0.10.1/go.mod h1:c5y0hIOBCfszmBcLJyxnELF30gC1qC/NeHdmkzA7TNQ= +cloud.google.com/go/datacatalog v1.23.0 h1:9F2zIbWNNmtrSkPIyGRQNsIugG5VgVVFip6+tXSdWLg= +cloud.google.com/go/datacatalog v1.23.0/go.mod h1:9Wamq8TDfL2680Sav7q3zEhBJSPBrDxJU8WtPJ25dBM= +cloud.google.com/go/dataflow v0.10.2 h1:o9P5/zR2mOYJmCnfp9/7RprKFZCwmSu3TvemQSmCaFM= +cloud.google.com/go/dataflow v0.10.2/go.mod h1:+HIb4HJxDCZYuCqDGnBHZEglh5I0edi/mLgVbxDf0Ag= +cloud.google.com/go/dataform v0.10.2 h1:t16DoejuOHoxJR88qrpdmFFlCXA9+x5PKrqI9qiDYz0= +cloud.google.com/go/dataform v0.10.2/go.mod h1:oZHwMBxG6jGZCVZqqMx+XWXK+dA/ooyYiyeRbUxI15M= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= cloud.google.com/go/discoveryengine v1.15.0 h1:CHUN1mbs5iTqWJRuU6rZCvcuV5iVMr/rW8Kr1ivn7p4= @@ -59,16 +61,16 @@ cloud.google.com/go/discoveryengine v1.15.0/go.mod h1:WIstQLougDQ6D8cza4icHFfGGz cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= cloud.google.com/go/firestore v1.17.0 h1:iEd1LBbkDZTFsLw3sTH50eyg4qe8eoG6CjocmEXO9aQ= cloud.google.com/go/firestore v1.17.0/go.mod h1:69uPx1papBsY8ZETooc71fOhoKkD70Q1DwMrtKuOT/Y= -cloud.google.com/go/gkemulticloud v1.4.0 h1:t2HXXYrICui+rZXScietjU1YdrQDLXpfqqrTo7zWSYQ= -cloud.google.com/go/gkemulticloud v1.4.0/go.mod h1:rg8YOQdRKEtMimsiNCzZUP74bOwImhLRv9wQ0FwBUP4= -cloud.google.com/go/iam v1.2.1 h1:QFct02HRb7H12J/3utj0qf5tobFh9V4vR6h9eX5EBRU= -cloud.google.com/go/iam v1.2.1/go.mod h1:3VUIJDPpwT6p/amXRC5GY8fCCh70lxPygguVtI0Z4/g= -cloud.google.com/go/kms v1.20.0 h1:uKUvjGqbBlI96xGE669hcVnEMw1Px/Mvfa62dhM5UrY= -cloud.google.com/go/kms v1.20.0/go.mod h1:/dMbFF1tLLFnQV44AoI2GlotbjowyUfgVwezxW291fM= -cloud.google.com/go/longrunning v0.6.1 h1:lOLTFxYpr8hcRtcwWir5ITh1PAKUD/sG2lKrTSYjyMc= -cloud.google.com/go/longrunning v0.6.1/go.mod h1:nHISoOZpBcmlwbJmiVk5oDRz0qG/ZxPynEGs1iZ79s0= -cloud.google.com/go/monitoring v1.21.1 h1:zWtbIoBMnU5LP9A/fz8LmWMGHpk4skdfeiaa66QdFGc= -cloud.google.com/go/monitoring v1.21.1/go.mod h1:Rj++LKrlht9uBi8+Eb530dIrzG/cU/lB8mt+lbeFK1c= +cloud.google.com/go/gkemulticloud v1.4.1 h1:SvVD2nJTGScEDYygIQ5dI14oFYhgtJx8HazkT3aufEI= +cloud.google.com/go/gkemulticloud v1.4.1/go.mod h1:KRvPYcx53bztNwNInrezdfNF+wwUom8Y3FuJBwhvFpQ= +cloud.google.com/go/iam v1.2.2 h1:ozUSofHUGf/F4tCNy/mu9tHLTaxZFLOUiKzjcgWHGIA= +cloud.google.com/go/iam v1.2.2/go.mod h1:0Ys8ccaZHdI1dEUilwzqng/6ps2YB6vRsjIe00/+6JY= +cloud.google.com/go/kms v1.20.1 h1:og29Wv59uf2FVaZlesaiDAqHFzHaoUyHI3HYp9VUHVg= +cloud.google.com/go/kms v1.20.1/go.mod h1:LywpNiVCvzYNJWS9JUcGJSVTNSwPwi0vBAotzDqn2nc= +cloud.google.com/go/longrunning v0.6.2 h1:xjDfh1pQcWPEvnfjZmwjKQEcHnpz6lHjfy7Fo0MK+hc= +cloud.google.com/go/longrunning v0.6.2/go.mod h1:k/vIs83RN4bE3YCswdXC5PFfWVILjm3hpEUlSko4PiI= +cloud.google.com/go/monitoring v1.21.2 h1:FChwVtClH19E7pJ+e0xUhJPGksctZNVOk2UhMmblmdU= +cloud.google.com/go/monitoring v1.21.2/go.mod h1:hS3pXvaG8KgWTSz+dAdyzPrGUYmi2Q+WFX8g2hqVEZU= cloud.google.com/go/privilegedaccessmanager v0.2.1 h1:8a9N5vXTVaEUsTOVxpY7bI354vjS9jVOY8FjwMRfWTI= cloud.google.com/go/privilegedaccessmanager v0.2.1/go.mod h1:SLpUBHDUJXkaiBy5N8h9HLYb5/a+5me8I881Yy8NISE= cloud.google.com/go/profiler v0.4.1 h1:Q7+lOvikTGMJ/IAWocpYYGit4SIIoILmVZfEEWTORSY= @@ -77,16 +79,16 @@ cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2k cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= -cloud.google.com/go/redis v1.17.1 h1:E7TeGsvyoFB+m59bqFKrQ5GSH7+uW8cUDk6Y7iqGjJ0= -cloud.google.com/go/redis v1.17.1/go.mod h1:YJHeYfSoW/agIMeCvM5rszxu75mVh5DOhbu3AEZEIQM= -cloud.google.com/go/resourcemanager v1.10.1 h1:fO/QoSJ1lepmTM9dCbSXYWgTIhecmQkpY0mM1X9OGN0= -cloud.google.com/go/resourcemanager v1.10.1/go.mod h1:A/ANV/Sv7y7fcjd4LSH7PJGTZcWRkO/69yN5UhYUmvE= -cloud.google.com/go/secretmanager v1.14.1 h1:xlWSIg8rtBn5qCr2f3XtQP19+5COyf/ll49SEvi/0vM= -cloud.google.com/go/secretmanager v1.14.1/go.mod h1:L+gO+u2JA9CCyXpSR8gDH0o8EV7i/f0jdBOrUXcIV0U= +cloud.google.com/go/redis v1.17.2 h1:QbW264RBH+NSVEQqlDoHfoxcreXK8QRRByTOR2CFbJs= +cloud.google.com/go/redis v1.17.2/go.mod h1:h071xkcTMnJgQnU/zRMOVKNj5J6AttG16RDo+VndoNo= +cloud.google.com/go/resourcemanager v1.10.2 h1:LpqZZGM0uJiu1YWM878AA8zZ/qOQ/Ngno60Q8RAraAI= +cloud.google.com/go/resourcemanager v1.10.2/go.mod h1:5f+4zTM/ZOTDm6MmPOp6BQAhR0fi8qFPnvVGSoWszcc= +cloud.google.com/go/secretmanager v1.14.2 h1:2XscWCfy//l/qF96YE18/oUaNJynAx749Jg3u0CjQr8= +cloud.google.com/go/secretmanager v1.14.2/go.mod h1:Q18wAPMM6RXLC/zVpWTlqq2IBSbbm7pKBlM3lCKsmjw= cloud.google.com/go/securesourcemanager v1.1.1 h1:raOxRsR507ALLlc5yG79LK7O2TuDbD7o7IyHwyCoYAE= cloud.google.com/go/securesourcemanager v1.1.1/go.mod h1:qMVTY4bzBRhcrUe0B8KvDCK5mhGQD6PyrHbzqOn3TLQ= -cloud.google.com/go/security v1.18.1 h1:w7XbMR90Ir0y8NUxKJ3uyRHuHYWPUxVI5Z/sGqbrdAQ= -cloud.google.com/go/security v1.18.1/go.mod h1:5P1q9rqwt0HuVeL9p61pTqQ6Lgio1c64jL2ZMWZV21Y= +cloud.google.com/go/security v1.18.2 h1:9Nzp9LGjiDvHqy7X7Q9GrS5lIHN0bI8RvDjkrl4ILO0= +cloud.google.com/go/security v1.18.2/go.mod h1:3EwTcYw8554iEtgK8VxAjZaq2unFehcsgFIF9nOvQmU= cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= @@ -152,6 +154,8 @@ github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYU github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be h1:9AeTilPcZAjCFIImctFaOjnTIavg87rW78vTPkQqLI8= github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be/go.mod h1:ySMOLuWl6zY27l47sB3qLNK6tF2fkHG55UZxx8oIVo4= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= +github.com/apache/arrow/go/v15 v15.0.2 h1:60IliRbiyTWCWjERBCkO1W4Qun9svcYoZrSLcyOsMLE= +github.com/apache/arrow/go/v15 v15.0.2/go.mod h1:DGXsR3ajT524njufqf95822i+KTh+yea1jass9YXgjA= github.com/apparentlymart/go-cidr v1.1.0 h1:2mAhrMoF+nhXqxTzSZMUzDHkLjmIHC+Zzn4tdgBZjnU= github.com/apparentlymart/go-cidr v1.1.0/go.mod h1:EBcsNrHc3zQeuaeCeCtQruQm+n9/YjEn/vI25Lg7Gwc= github.com/apparentlymart/go-dump v0.0.0-20180507223929-23540a00eaa3/go.mod h1:oL81AME2rN47vu18xqj1S1jPIPuN7afo62yKTNn3XMM= @@ -405,6 +409,8 @@ github.com/go-test/deep v1.0.7 h1:/VSMRlnY/JSyqxQUzQLKVMAskpY/NZKFA5j2P+0pP2M= github.com/go-test/deep v1.0.7/go.mod h1:QV8Hv/iy04NyLBxAdO9njL0iVPN1S4d/A3NVv1V36o8= github.com/gobuffalo/flect v0.2.3 h1:f/ZukRnSNA/DUpSNDadko7Qc0PhGvsew35p/2tu+CRY= github.com/gobuffalo/flect v0.2.3/go.mod h1:vmkQwuZYhN5Pc4ljYQZzP+1sq+NEkK+lh20jmEmX3jc= +github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU= +github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= @@ -459,6 +465,8 @@ github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Z github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.1.3 h1:CVpQJjYgC4VbzxeGVHfvZrv1ctoYCAI8vbl07Fcxlyg= github.com/google/btree v1.1.3/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4= +github.com/google/flatbuffers v23.5.26+incompatible h1:M9dgRyhJemaM4Sw8+66GHBu8ioaQmyPLg1b8VwK5WJg= +github.com/google/flatbuffers v23.5.26+incompatible/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= github.com/google/gnostic v0.6.9 h1:ZK/5VhkoX835RikCHpSUJV9a+S3e1zLh59YnyWeBW+0= github.com/google/gnostic v0.6.9/go.mod h1:Nm8234We1lq6iB9OmlgNv3nH91XLLVZHCDayfA3xq+E= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= @@ -484,9 +492,12 @@ github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/ github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/martian/v3 v3.3.3 h1:DIhPTQrbPkgs2yJYdXU/eNACCG5DVQjySNRNlflZ9Fc= +github.com/google/martian/v3 v3.3.3/go.mod h1:iEPrYcgCF7jA9OtScMFQyAlZZ4YXTKEtJ1E6RWzmBA0= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= @@ -514,8 +525,8 @@ github.com/googleapis/enterprise-certificate-proxy v0.3.4 h1:XYIDZApgAnrN1c855gT github.com/googleapis/enterprise-certificate-proxy v0.3.4/go.mod h1:YKe7cfqYXjKGpGvmSg28/fFvhNzinZQm8DGnaburhGA= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/googleapis/gax-go/v2 v2.13.0 h1:yitjD5f7jQHhyDsnhKEBU52NdvvdSeGzlAnDPT0hH1s= -github.com/googleapis/gax-go/v2 v2.13.0/go.mod h1:Z/fvTZXF8/uw7Xu5GuslPw+bplx6SS338j1Is2S+B7A= +github.com/googleapis/gax-go/v2 v2.14.0 h1:f+jMrjBPl+DL9nI4IQzLUxMq7XrAqFYB7hBPqMNIe8o= +github.com/googleapis/gax-go/v2 v2.14.0/go.mod h1:lhBCnjdLrWRaPvLWhmc8IS24m9mr07qSYnHncrgo+zk= github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= github.com/googleapis/gnostic v0.3.1/go.mod h1:on+2t9HRStVgn95RSsFWFz+6Q0Snyqv1awfrALZdbtU= github.com/googleapis/gnostic v0.4.1/go.mod h1:LRhVm6pbyptWbWbuZ38d1eyptfvIytN3ir6b65WBswg= @@ -658,6 +669,10 @@ github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvW github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= 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/klauspost/compress v1.16.7 h1:2mk3MPGNzKyxErAw8YaohYh69+pa4sIQSC0fPGCFR9I= +github.com/klauspost/compress v1.16.7/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= +github.com/klauspost/cpuid/v2 v2.2.5 h1:0E5MSMDEoAulmXNFquVs//DdoomxaoTY1kUhbc/qbZg= +github.com/klauspost/cpuid/v2 v2.2.5/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= @@ -792,6 +807,8 @@ github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/9 github.com/pelletier/go-toml v1.9.3/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= github.com/peterbourgon/diskv v2.0.1+incompatible h1:UBdAOUP5p4RWqPBg048CAvpKN+vxiaj6gdUUzhl4XmI= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= +github.com/pierrec/lz4/v4 v4.1.18 h1:xaKrnTkyoqfh1YItXl56+6KJNVYWlEEPuAQW9xsplYQ= +github.com/pierrec/lz4/v4 v4.1.18/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= 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.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -952,6 +969,10 @@ github.com/zclconf/go-cty v1.10.0/go.mod h1:vVKLxnk3puL4qRAv72AO+W99LUD4da90g3uU github.com/zclconf/go-cty v1.13.0 h1:It5dfKTTZHe9aeppbNOda3mN7Ag7sg6QkBNm6TkyFa0= github.com/zclconf/go-cty v1.13.0/go.mod h1:YKQzy/7pZ7iq2jNFzy5go57xdxdWoLLpaEp4u238AE0= github.com/zclconf/go-cty-debug v0.0.0-20191215020915-b22d67c1ba0b/go.mod h1:ZRKQfBXbGkpdV6QMzT3rU1kSTAnfu1dO8dPKjYprgj8= +github.com/zeebo/assert v1.3.0 h1:g7C04CbJuIDKNPFHmsk4hwZDO5O+kntRxzaUoNXj+IQ= +github.com/zeebo/assert v1.3.0/go.mod h1:Pq9JiuJQpG8JLJdtkwrJESF0Foym2/D9XMU5ciN/wJ0= +github.com/zeebo/xxh3 v1.0.2 h1:xZmwmqxHZA8AI603jOQ0tMqmBr9lPeFwGg6d+xy9DC0= +github.com/zeebo/xxh3 v1.0.2/go.mod h1:5NWz9Sef7zIDm2JHfFlcQvNekmcEl9ekUZQQKCYaDcA= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.5/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ= @@ -1028,8 +1049,8 @@ golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= -golang.org/x/crypto v0.28.0 h1:GBDwsMXVQi34v5CCYUm2jkJvu4cbtru2U4TN2PSyQnw= -golang.org/x/crypto v0.28.0/go.mod h1:rmgy+3RHxRZMyY0jjAJShp2zgEdOqj2AO7U0pYmeQ7U= +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-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1042,6 +1063,8 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= +golang.org/x/exp v0.0.0-20231006140011-7918f672742d h1:jtJma62tbqLibJ5sFQz8bKtEM8rJBtfilJ2qTU199MI= +golang.org/x/exp v0.0.0-20231006140011-7918f672742d/go.mod h1:ldy0pHrwJyGW56pPQzzkH36rKxoZW1tw7ZJpeKx+hdo= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -1132,8 +1155,8 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= -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/net v0.31.0 h1:68CPQngjLL0r2AlUKiSxtQFKvzRVbnzLwMUn5SzcLHo= +golang.org/x/net v0.31.0/go.mod h1:P4fl1q7dY2hnZFxEk4pPSkDHF+QqjitcnDjUQyMM+pM= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1146,8 +1169,8 @@ golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210402161424-2e8d93401602/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.23.0 h1:PbgcYx2W7i4LvjJWEbf0ngHV6qJYr86PkAV3bXdLEbs= -golang.org/x/oauth2 v0.23.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= +golang.org/x/oauth2 v0.24.0 h1:KTBBxWqUa0ykRPLtV69rRto9TLXcqYkeswu48x/gvNE= +golang.org/x/oauth2 v0.24.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 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= @@ -1161,8 +1184,8 @@ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.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-20170830134202-bb24a47a89ea/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180117170059-2c42eef0765b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1248,8 +1271,8 @@ golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.3.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-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= @@ -1257,8 +1280,8 @@ golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuX golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= -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.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1274,15 +1297,15 @@ 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.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -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/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.7.0 h1:ntUhktv3OPE6TgYxXWv9vKvUSJyIFJlyohwbkEwPrKQ= -golang.org/x/time v0.7.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= +golang.org/x/time v0.8.0 h1:9i3RxcPv3PZnitoVGMPDKZSq1xW1gK1Xy3ArNOGZfEg= +golang.org/x/time v0.8.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181011042414-1f849cf54d09/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -1352,10 +1375,14 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da h1:noIWHXmPHxILtqtCOPIhSt0ABwskkZKjD3bXGnZGpNY= +golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da/go.mod h1:NDW/Ps6MPRej6fsCIbMTohpP40sJ/P/vI1MoTEGwX90= gomodules.xyz/jsonpatch/v2 v2.0.1/go.mod h1:IhYNNY4jnS53ZnfE4PAmpKtDpTCj1JFXc+3mwe7XcUU= gomodules.xyz/jsonpatch/v2 v2.3.0 h1:8NFhfS6gzxNqjLIYnZxg319wZ5Qjnx4m/CcX+Klzazc= gomodules.xyz/jsonpatch/v2 v2.3.0/go.mod h1:AH3dM2RI6uoBZxn3LVrfvJ3E0/9dG4cSrbuBJT4moAY= gonum.org/v1/gonum v0.0.0-20190331200053-3d26580ed485/go.mod h1:2ltnJ7xHfj0zHS40VVPYEAAMTa3ZGguvHGBSJeRWqE0= +gonum.org/v1/gonum v0.12.0 h1:xKuo6hzt+gMav00meVPUlXwSdoEJP46BR+wdxQEFK2o= +gonum.org/v1/gonum v0.12.0/go.mod h1:73TDxJfAAHeA8Mk9mf8NlIppyhQNo5GLTcYeqgo2lvY= gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= gonum.org/v1/netlib v0.0.0-20190331212654-76723241ea4e/go.mod h1:kS+toOQn6AQKjmKJ7gzohV1XkqsFehRA2FbsbkopSuQ= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= @@ -1380,8 +1407,8 @@ google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjR google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU= google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= google.golang.org/api v0.44.0/go.mod h1:EBOGZqzyhtvMDoxwS97ctnh0zUmYY6CxqXsc1AvkYD8= -google.golang.org/api v0.203.0 h1:SrEeuwU3S11Wlscsn+LA1kb/Y5xT8uggJSkIhD08NAU= -google.golang.org/api v0.203.0/go.mod h1:BuOVyCSYEPwJb3npWvDnNmFI92f3GeRnHNkETneT3SI= +google.golang.org/api v0.210.0 h1:HMNffZ57OoZCRYSbdWVRoqOa8V8NIHLL0CzdBPLztWk= +google.golang.org/api v0.210.0/go.mod h1:B9XDZGnx2NtyjzVkOVTGrFSAVZgPcbedzKg/gTLwqBs= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -1435,12 +1462,12 @@ google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20220107163113-42d7afdf6368/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20241015192408-796eee8c2d53 h1:Df6WuGvthPzc+JiQ/G+m+sNX24kc0aTBqoDN/0yyykE= -google.golang.org/genproto v0.0.0-20241015192408-796eee8c2d53/go.mod h1:fheguH3Am2dGp1LfXkrvwqC/KlFq8F0nLq3LryOMrrE= -google.golang.org/genproto/googleapis/api v0.0.0-20241007155032-5fefd90f89a9 h1:T6rh4haD3GVYsgEfWExoCZA2o2FmbNyKpTuAxbEFPTg= -google.golang.org/genproto/googleapis/api v0.0.0-20241007155032-5fefd90f89a9/go.mod h1:wp2WsuBYj6j8wUdo3ToZsdxxixbvQNAHqVJrTgi5E5M= -google.golang.org/genproto/googleapis/rpc v0.0.0-20241015192408-796eee8c2d53 h1:X58yt85/IXCx0Y3ZwN6sEIKZzQtDEYaBWrDvErdXrRE= -google.golang.org/genproto/googleapis/rpc v0.0.0-20241015192408-796eee8c2d53/go.mod h1:GX3210XPVPUjJbTUbvwI8f2IpZDMZuPJWDzDuebbviI= +google.golang.org/genproto v0.0.0-20241118233622-e639e219e697 h1:ToEetK57OidYuqD4Q5w+vfEnPvPpuTwedCNVohYJfNk= +google.golang.org/genproto v0.0.0-20241118233622-e639e219e697/go.mod h1:JJrvXBWRZaFMxBufik1a4RpFw4HhgVtBBWQeQgUj2cc= +google.golang.org/genproto/googleapis/api v0.0.0-20241113202542-65e8d215514f h1:M65LEviCfuZTfrfzwwEoxVtgvfkFkBUbFnRbxCXuXhU= +google.golang.org/genproto/googleapis/api v0.0.0-20241113202542-65e8d215514f/go.mod h1:Yo94eF2nj7igQt+TiJ49KxjIH8ndLYPZMIRSiRcEbg0= +google.golang.org/genproto/googleapis/rpc v0.0.0-20241118233622-e639e219e697 h1:LWZqQOEjDyONlF1H6afSWpAL/znlREo2tHfLoe+8LMA= +google.golang.org/genproto/googleapis/rpc v0.0.0-20241118233622-e639e219e697/go.mod h1:5uTbfoYQed2U9p3KIj2/Zzm02PYhndfdmML0qC3q3FU= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= @@ -1477,8 +1504,8 @@ google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlba 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/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.35.1 h1:m3LfL6/Ca+fqnjnlqQXNpFPABW1UD7mjh8KO2mKFytA= -google.golang.org/protobuf v1.35.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= +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/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= 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= diff --git a/mockgcp/mockbigquery/datasets.go b/mockgcp/mockbigquery/datasets.go index 6dc1d09efe..e158f22872 100644 --- a/mockgcp/mockbigquery/datasets.go +++ b/mockgcp/mockbigquery/datasets.go @@ -209,6 +209,43 @@ func (s *datasetsServer) UpdateDataset(ctx context.Context, req *pb.UpdateDatase return updated, err } +func (s *datasetsServer) PatchDataset(ctx context.Context, req *pb.PatchDatasetRequest) (*pb.Dataset, error) { + name, err := s.buildDatasetName(req.GetProjectId(), req.GetDatasetId()) + if err != nil { + return nil, err + } + + fqn := name.String() + + existing := &pb.Dataset{} + if err := s.storage.Get(ctx, fqn, existing); err != nil { + return nil, err + } + + now := time.Now() + + updated := req.GetDataset() + updated.DatasetReference = existing.DatasetReference + + updated.CreationTime = existing.CreationTime + updated.LastModifiedTime = PtrTo(now.UnixMilli()) + updated.Id = PtrTo(existing.GetDatasetReference().GetProjectId() + ":" + existing.GetDatasetReference().GetDatasetId()) + updated.Kind = PtrTo("bigquery#dataset") + updated.Location = existing.Location + updated.Type = existing.Type + updated.SelfLink = PtrTo("https://bigquery.googleapis.com/bigquery/v2/" + name.String()) + + sortAccess(updated) + + updated.Etag = PtrTo(computeEtag(updated)) + + if err := s.storage.Update(ctx, fqn, updated); err != nil { + return nil, err + } + + return updated, err +} + func (s *datasetsServer) DeleteDataset(ctx context.Context, req *pb.DeleteDatasetRequest) (*empty.Empty, error) { name, err := s.buildDatasetName(req.GetProjectId(), req.GetDatasetId()) if err != nil { diff --git a/pkg/controller/direct/bigquerydataset/bigquerydataset_mappings.go b/pkg/controller/direct/bigquerydataset/bigquerydataset_mappings.go index 14f5462b9c..80d167d704 100644 --- a/pkg/controller/direct/bigquerydataset/bigquerydataset_mappings.go +++ b/pkg/controller/direct/bigquerydataset/bigquerydataset_mappings.go @@ -21,210 +21,311 @@ package bigquerydataset import ( + "fmt" + "slices" "strconv" + "strings" + "time" + pb "cloud.google.com/go/bigquery" krm "github.com/GoogleCloudPlatform/k8s-config-connector/apis/bigquery/v1beta1" "github.com/GoogleCloudPlatform/k8s-config-connector/apis/refs/v1beta1" "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/controller/direct" - api "google.golang.org/api/bigquery/v2" ) -func BigQueryDatasetSpec_ToAPI(mapCtx *direct.MapContext, in *krm.BigQueryDatasetSpec, name string) *api.Dataset { +func BigQueryDatasetSpec_ToProto(mapCtx *direct.MapContext, in *krm.BigQueryDatasetSpec) *pb.DatasetMetadata { if in == nil { return nil } - out := &api.Dataset{} - acccessList := []*api.DatasetAccess{} + out := &pb.DatasetMetadata{} + acccessList := []*pb.AccessEntry{} for _, access := range in.Access { - curAccess := Access_ToAPI(mapCtx, direct.LazyPtr(access)) + curAccess := AccessEntry_ToProto(mapCtx, direct.LazyPtr(access)) acccessList = append(acccessList, curAccess) } out.Access = acccessList out.DefaultCollation = direct.ValueOf(in.DefaultCollation) - out.DefaultPartitionExpirationMs = direct.ValueOf(in.DefaultPartitionExpirationMs) - out.DefaultTableExpirationMs = direct.ValueOf(in.DefaultTableExpirationMs) - out.DefaultEncryptionConfiguration = EncryptionConfiguration_ToAPI(mapCtx, in.DefaultEncryptionConfiguration) + out.DefaultPartitionExpiration = time.Duration(direct.ValueOf(in.DefaultPartitionExpirationMs)) * time.Millisecond + out.DefaultTableExpiration = time.Duration(direct.ValueOf(in.DefaultTableExpirationMs)) * time.Millisecond + out.DefaultEncryptionConfig = EncryptionConfiguration_ToProto(mapCtx, in.DefaultEncryptionConfiguration) out.Description = direct.ValueOf(in.Description) - out.FriendlyName = direct.ValueOf(in.FriendlyName) - out.DatasetReference = DatasetReference_ToAPI(mapCtx, in, name) out.Location = direct.ValueOf(in.Location) - out.IsCaseInsensitive = direct.ValueOf(in.IsCaseInsensitive) if in.MaxTimeTravelHours != nil { - out.MaxTimeTravelHours, _ = strconv.ParseInt(direct.ValueOf(in.MaxTimeTravelHours), 10, 64) + maxHours, _ := strconv.ParseInt(direct.ValueOf(in.MaxTimeTravelHours), 10, 64) + out.MaxTimeTravel = time.Duration(maxHours) * time.Hour } + out.IsCaseInsensitive = direct.ValueOf(in.IsCaseInsensitive) + out.Name = direct.ValueOf(in.FriendlyName) out.StorageBillingModel = direct.ValueOf(in.StorageBillingModel) return out } -func BigQueryDatasetSpec_FromAPI(mapCtx *direct.MapContext, in *api.Dataset) *krm.BigQueryDatasetSpec { +func BigQueryDatasetSpec_FromProto(mapCtx *direct.MapContext, in *pb.DatasetMetadata) *krm.BigQueryDatasetSpec { if in == nil { return nil } out := &krm.BigQueryDatasetSpec{} accessList := []krm.Access{} for _, access := range in.Access { - curAccess := Access_FromAPI(mapCtx, access) + curAccess := AccessEntry_FromProto(mapCtx, access) accessList = append(accessList, direct.ValueOf(curAccess)) } out.Access = accessList out.DefaultCollation = direct.LazyPtr(in.DefaultCollation) - out.DefaultPartitionExpirationMs = direct.LazyPtr(in.DefaultPartitionExpirationMs) - out.DefaultTableExpirationMs = direct.LazyPtr(in.DefaultTableExpirationMs) - out.DefaultEncryptionConfiguration = EncryptionConfiguration_FromAPI(mapCtx, in.DefaultEncryptionConfiguration) + out.DefaultPartitionExpirationMs = direct.LazyPtr(in.DefaultPartitionExpiration.Milliseconds()) + out.DefaultTableExpirationMs = direct.LazyPtr(in.DefaultTableExpiration.Milliseconds()) + out.DefaultEncryptionConfiguration = EncryptionConfiguration_FromProto(mapCtx, in.DefaultEncryptionConfig) out.Description = direct.LazyPtr(in.Description) - out.FriendlyName = direct.LazyPtr(in.FriendlyName) + out.FriendlyName = direct.LazyPtr(in.Name) out.Location = direct.LazyPtr(in.Location) + maxTimeInHours := fmt.Sprintf("%v", in.MaxTimeTravel.Hours()) + out.MaxTimeTravelHours = direct.LazyPtr(maxTimeInHours) out.IsCaseInsensitive = direct.LazyPtr(in.IsCaseInsensitive) - maxTime := strconv.FormatInt(in.MaxTimeTravelHours, 10) - out.MaxTimeTravelHours = direct.LazyPtr(maxTime) out.StorageBillingModel = direct.LazyPtr(in.StorageBillingModel) return out } -func BigQueryDatasetStatus_FromAPI(mapCtx *direct.MapContext, in *api.Dataset) *krm.BigQueryDatasetStatus { +func BigQueryDatasetStatus_FromProto(mapCtx *direct.MapContext, in *pb.DatasetMetadata) *krm.BigQueryDatasetStatus { if in == nil { return nil } out := &krm.BigQueryDatasetStatus{} - out.Etag = direct.LazyPtr(in.Etag) - out.CreationTime = direct.LazyPtr(in.CreationTime) - out.LastModifiedTime = direct.LazyPtr(in.LastModifiedTime) - out.SelfLink = direct.LazyPtr(in.SelfLink) + out.Etag = direct.LazyPtr(in.ETag) + out.CreationTime = direct.LazyPtr(in.CreationTime.UnixMilli()) + out.LastModifiedTime = direct.LazyPtr(in.LastModifiedTime.UnixMilli()) + // The full dataset ID in the form projectID:datasetID + tokens := strings.Split(in.FullID, ":") + if len(tokens) == 2 { + out.SelfLink = direct.LazyPtr(fmt.Sprintf("https://bigquery.googleapis.com/bigquery/v2/projects/%s/datasets/%s", tokens[0], tokens[1])) + } out.ObservedState = &krm.BigQueryDatasetObservedState{Location: direct.LazyPtr(in.Location)} return out } -func BigQueryDatasetStatus_ToAPI(mapCtx *direct.MapContext, in *krm.BigQueryDatasetStatus) *api.Dataset { +func BigQueryDatasetStatus_ToProto(mapCtx *direct.MapContext, in *krm.BigQueryDatasetStatus) *pb.DatasetMetadata { if in == nil { return nil } - out := &api.Dataset{} - out.Etag = direct.ValueOf(in.Etag) - out.CreationTime = direct.ValueOf(in.CreationTime) - out.LastModifiedTime = direct.ValueOf(in.LastModifiedTime) - out.SelfLink = direct.ValueOf(in.SelfLink) - out.Location = direct.ValueOf(in.ObservedState.Location) + out := &pb.DatasetMetadata{} + out.ETag = direct.ValueOf(in.Etag) + out.CreationTime = direct.UnixMillisToTime(direct.ValueOf(in.CreationTime)) + out.LastModifiedTime = direct.UnixMillisToTime(direct.ValueOf(in.LastModifiedTime)) + // The full dataset ID in the form projectID:datasetID + if in.SelfLink != nil { + selfLink := strings.Trim(direct.ValueOf(in.SelfLink), "https://bigquery.googleapis.com/bigquery/v2/") + tokens := strings.Split(selfLink, "/") + if len(tokens) == 4 && tokens[0] == "projects" && tokens[2] == "datasets" { + out.FullID = fmt.Sprintf("%s:%s", tokens[1], tokens[3]) + } + } return out } -func Access_ToAPI(mapCtx *direct.MapContext, in *krm.Access) *api.DatasetAccess { +func AccessEntry_ToProto(mapCtx *direct.MapContext, in *krm.Access) *pb.AccessEntry { if in == nil { return nil } - out := &api.DatasetAccess{} - out.Domain = direct.ValueOf(in.Domain) - out.GroupByEmail = direct.ValueOf(in.GroupByEmail) - out.IamMember = direct.ValueOf(in.IamMember) - out.UserByEmail = direct.ValueOf(in.UserByEmail) - out.SpecialGroup = direct.ValueOf(in.SpecialGroup) - out.Role = direct.ValueOf(in.Role) - out.Dataset = DatasetAccessEntry_ToAPI(mapCtx, in.Dataset) - out.Routine = RoutineReference_ToAPI(mapCtx, in.Routine) - out.View = TableReference_ToAPI(mapCtx, in.View) + out := &pb.AccessEntry{} + out.Role = pb.AccessRole(direct.ValueOf(in.Role)) + switch { + case in.Domain != nil: + out.Entity = direct.ValueOf(in.Domain) + out.EntityType = pb.DomainEntity + case in.GroupByEmail != nil: + out.Entity = direct.ValueOf(in.GroupByEmail) + out.EntityType = pb.GroupEmailEntity + case in.UserByEmail != nil: + out.Entity = direct.ValueOf(in.UserByEmail) + out.EntityType = pb.UserEmailEntity + case in.SpecialGroup != nil: + out.Entity = direct.ValueOf(in.SpecialGroup) + out.EntityType = pb.SpecialGroupEntity + case in.View != nil: + out.View = TableReference_ToProto(mapCtx, in.View) + out.EntityType = pb.ViewEntity + case in.IamMember != nil: + out.Entity = direct.ValueOf(in.IamMember) + out.EntityType = pb.IAMMemberEntity + case in.Routine != nil: + out.Routine = RoutineReference_ToProto(mapCtx, in.Routine) + out.EntityType = pb.ViewEntity + case in.Dataset != nil: + out.Dataset = DatasetAccessEntry_ToProto(mapCtx, in.Dataset) + out.EntityType = pb.ViewEntity + } return out } -func Access_FromAPI(mapCtx *direct.MapContext, in *api.DatasetAccess) *krm.Access { +func AccessEntry_FromProto(mapCtx *direct.MapContext, in *pb.AccessEntry) *krm.Access { if in == nil { return nil } out := &krm.Access{} - out.Domain = direct.LazyPtr(in.Domain) - out.GroupByEmail = direct.LazyPtr(in.GroupByEmail) - out.IamMember = direct.LazyPtr(in.IamMember) - out.UserByEmail = direct.LazyPtr(in.UserByEmail) - out.SpecialGroup = direct.LazyPtr(in.SpecialGroup) - out.Role = direct.LazyPtr(in.Role) - out.Dataset = DatasetAccessEntry_FromAPI(mapCtx, in.Dataset) - out.Routine = RoutineReference_FromAPI(mapCtx, in.Routine) - out.View = TableReference_FromAPI(mapCtx, in.View) + out.Role = direct.LazyPtr(string(in.Role)) + switch in.EntityType { + case pb.DomainEntity: + out.Domain = direct.LazyPtr(in.Entity) + case pb.GroupEmailEntity: + out.GroupByEmail = direct.LazyPtr(in.Entity) + case pb.UserEmailEntity: + out.UserByEmail = direct.LazyPtr(in.Entity) + case pb.SpecialGroupEntity: + out.SpecialGroup = direct.LazyPtr(in.Entity) + case pb.ViewEntity: + out.View = TableReference_FromProto(mapCtx, in.View) + case pb.IAMMemberEntity: + out.IamMember = direct.LazyPtr(in.Entity) + case pb.RoutineEntity: + out.Routine = RoutineReference_FromProto(mapCtx, in.Routine) + case pb.DatasetEntity: + out.Dataset = DatasetAccessEntry_FromProto(mapCtx, in.Dataset) + } return out } -func DatasetAccessEntry_FromAPI(mapCtx *direct.MapContext, in *api.DatasetAccessEntry) *krm.DatasetAccessEntry { +func BigQueryDataset_ToMetadataToUpdate(mapCtx *direct.MapContext, in *pb.DatasetMetadata, updatePaths []string) *pb.DatasetMetadataToUpdate { + if in == nil { + return nil + } + out := &pb.DatasetMetadataToUpdate{} + acccessList := []*pb.AccessEntry{} + for _, access := range in.Access { + acccessList = append(acccessList, access) + } + out.Access = acccessList + if in.DefaultEncryptionConfig != nil { + out.DefaultEncryptionConfig = &pb.EncryptionConfig{ + KMSKeyName: in.DefaultEncryptionConfig.KMSKeyName, + } + } + // if the value to explicitly set to empty in the update request, we set the value. + // Otherwise, we drop the value. + if in.DefaultCollation != "" || slices.Contains(updatePaths, "default_collation") { + out.DefaultCollation = in.DefaultCollation + } + if in.DefaultPartitionExpiration != 0 || slices.Contains(updatePaths, "default_partition_expiration") { + out.DefaultPartitionExpiration = in.DefaultPartitionExpiration + } + if in.DefaultTableExpiration != 0 || slices.Contains(updatePaths, "default_table_expiration") { + out.DefaultTableExpiration = in.DefaultTableExpiration + } + if in.Description != "" || slices.Contains(updatePaths, "description") { + out.Description = in.Description + } + if in.MaxTimeTravel != 0 || slices.Contains(updatePaths, "max_time_travel") { + out.MaxTimeTravel = in.MaxTimeTravel + } + if slices.Contains(updatePaths, "is_case_sensitive") { + out.IsCaseInsensitive = in.IsCaseInsensitive + } + if in.Name != "" || slices.Contains(updatePaths, "friendly_name") { + out.Name = in.Name + } + if in.StorageBillingModel != "" || slices.Contains(updatePaths, "default_collation") { + out.StorageBillingModel = in.StorageBillingModel + } + return out +} +func DatasetAccessEntry_FromProto(mapCtx *direct.MapContext, in *pb.DatasetAccessEntry) *krm.DatasetAccessEntry { if in == nil { return nil } out := &krm.DatasetAccessEntry{} - out.Dataset = &krm.DatasetReference{ - DatasetId: direct.LazyPtr(in.Dataset.DatasetId), - ProjectId: direct.LazyPtr(in.Dataset.ProjectId), + out.Dataset = DatasetReference_FromProto(mapCtx, in.Dataset) + for _, targetType := range in.TargetTypes { + out.TargetTypes = append(out.TargetTypes, targetType) } - out.TargetTypes = in.TargetTypes return out } -func DatasetAccessEntry_ToAPI(mapCtx *direct.MapContext, in *krm.DatasetAccessEntry) *api.DatasetAccessEntry { +func DatasetAccessEntry_ToProto(mapCtx *direct.MapContext, in *krm.DatasetAccessEntry) *pb.DatasetAccessEntry { if in == nil { return nil } - out := &api.DatasetAccessEntry{} - out.Dataset = &api.DatasetReference{ - DatasetId: direct.ValueOf(in.Dataset.DatasetId), - ProjectId: direct.ValueOf(in.Dataset.ProjectId), + out := &pb.DatasetAccessEntry{} + out.Dataset = DatasetReference_ToProto(mapCtx, in.Dataset) + out.TargetTypes = make([]string, len(in.TargetTypes)) + for _, targetType := range in.TargetTypes { + out.TargetTypes = append(out.TargetTypes, targetType) } - out.TargetTypes = in.TargetTypes return out } -func DatasetReference_ToAPI(mapCtx *direct.MapContext, in *krm.BigQueryDatasetSpec, name string) *api.DatasetReference { +func DatasetReference_FromProto(mapCtx *direct.MapContext, in *pb.Dataset) *krm.DatasetReference { if in == nil { return nil } - out := &api.DatasetReference{} - out.DatasetId = name + out := &krm.DatasetReference{} + out.DatasetId = direct.LazyPtr(in.DatasetID) + out.ProjectId = direct.LazyPtr(in.ProjectID) return out } -func EncryptionConfiguration_ToAPI(mapCtx *direct.MapContext, in *krm.EncryptionConfiguration) *api.EncryptionConfiguration { +func DatasetReference_ToProto(mapCtx *direct.MapContext, in *krm.DatasetReference) *pb.Dataset { + if in == nil { + return nil + } + out := &pb.Dataset{} + out.DatasetID = direct.ValueOf(in.DatasetId) + out.ProjectID = direct.ValueOf(in.ProjectId) + return out +} +func DatasetSpec_ToExternalDatasetReference(mapCtx *direct.MapContext, in *krm.BigQueryDatasetSpec) *pb.ExternalDatasetReference { + // **NOTYET** + // There are no matching fields in KRM for now. + // out.Connection + // out.ExternalSource + return nil +} +func EncryptionConfiguration_ToProto(mapCtx *direct.MapContext, in *krm.EncryptionConfiguration) *pb.EncryptionConfig { if in == nil { return nil } - out := &api.EncryptionConfiguration{} + out := &pb.EncryptionConfig{} if in.KmsKeyRef != nil { - out.KmsKeyName = in.KmsKeyRef.External + out.KMSKeyName = in.KmsKeyRef.External } return out } -func EncryptionConfiguration_FromAPI(mapCtx *direct.MapContext, in *api.EncryptionConfiguration) *krm.EncryptionConfiguration { +func EncryptionConfiguration_FromProto(mapCtx *direct.MapContext, in *pb.EncryptionConfig) *krm.EncryptionConfiguration { if in == nil { return nil } out := &krm.EncryptionConfiguration{} out.KmsKeyRef = &v1beta1.KMSCryptoKeyRef{ - External: in.KmsKeyName, + External: in.KMSKeyName, } return out } -func RoutineReference_FromAPI(mapCtx *direct.MapContext, in *api.RoutineReference) *krm.RoutineReference { +func RoutineReference_FromProto(mapCtx *direct.MapContext, in *pb.Routine) *krm.RoutineReference { if in == nil { return nil } out := &krm.RoutineReference{} - out.DatasetId = direct.LazyPtr(in.DatasetId) - out.ProjectId = direct.LazyPtr(in.ProjectId) - out.RoutineId = direct.LazyPtr(in.RoutineId) + out.DatasetId = direct.LazyPtr(in.DatasetID) + out.ProjectId = direct.LazyPtr(in.ProjectID) + out.RoutineId = direct.LazyPtr(in.RoutineID) return out } -func RoutineReference_ToAPI(mapCtx *direct.MapContext, in *krm.RoutineReference) *api.RoutineReference { +func RoutineReference_ToProto(mapCtx *direct.MapContext, in *krm.RoutineReference) *pb.Routine { if in == nil { return nil } - out := &api.RoutineReference{} - out.DatasetId = direct.ValueOf(in.DatasetId) - out.ProjectId = direct.ValueOf(in.ProjectId) - out.RoutineId = direct.ValueOf(in.RoutineId) + out := &pb.Routine{} + out.DatasetID = direct.ValueOf(in.DatasetId) + out.ProjectID = direct.ValueOf(in.ProjectId) + out.RoutineID = direct.ValueOf(in.RoutineId) return out } -func TableReference_FromAPI(mapCtx *direct.MapContext, in *api.TableReference) *krm.TableReference { +func TableReference_FromProto(mapCtx *direct.MapContext, in *pb.Table) *krm.TableReference { if in == nil { return nil } out := &krm.TableReference{} - out.DatasetId = direct.LazyPtr(in.DatasetId) - out.ProjectId = direct.LazyPtr(in.ProjectId) - out.TableId = direct.LazyPtr(in.TableId) + out.DatasetId = direct.LazyPtr(in.DatasetID) + out.ProjectId = direct.LazyPtr(in.ProjectID) + out.TableId = direct.LazyPtr(in.TableID) return out } -func TableReference_ToAPI(mapCtx *direct.MapContext, in *krm.TableReference) *api.TableReference { +func TableReference_ToProto(mapCtx *direct.MapContext, in *krm.TableReference) *pb.Table { if in == nil { return nil } - out := &api.TableReference{} - out.DatasetId = direct.ValueOf(in.DatasetId) - out.ProjectId = direct.ValueOf(in.ProjectId) - out.TableId = direct.ValueOf(in.TableId) + out := &pb.Table{} + out.DatasetID = direct.ValueOf(in.DatasetId) + out.ProjectID = direct.ValueOf(in.ProjectId) + out.TableID = direct.ValueOf(in.TableId) return out } diff --git a/pkg/controller/direct/bigquerydataset/dataset_controller.go b/pkg/controller/direct/bigquerydataset/dataset_controller.go index b2f837d148..5b1f1348ce 100644 --- a/pkg/controller/direct/bigquerydataset/dataset_controller.go +++ b/pkg/controller/direct/bigquerydataset/dataset_controller.go @@ -25,9 +25,9 @@ import ( "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/controller/direct" "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/controller/direct/directbase" "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/controller/direct/registry" + "github.com/huandu/go-clone" - clone "github.com/huandu/go-clone" - api "google.golang.org/api/bigquery/v2" + bigquery "cloud.google.com/go/bigquery" "google.golang.org/api/option" "google.golang.org/protobuf/types/known/fieldmaskpb" @@ -56,13 +56,13 @@ type model struct { config config.ControllerConfig } -func (m *model) service(ctx context.Context) (*api.Service, error) { +func (m *model) service(ctx context.Context, projectID string) (*bigquery.Client, error) { var opts []option.ClientOption opts, err := m.config.RESTClientOptions() if err != nil { return nil, err } - gcpService, err := api.NewService(ctx, opts...) + gcpService, err := bigquery.NewClient(ctx, projectID, opts...) if err != nil { return nil, fmt.Errorf("building Dataset client: %w", err) } @@ -80,8 +80,14 @@ func (m *model) AdapterForObject(ctx context.Context, reader client.Reader, u *u return nil, err } + parent, _, err := krm.ParseBigQueryDatasetExternal(id.External) + projectID := parent.ProjectID + if projectID == "" { + return nil, fmt.Errorf("cannot resolve project ID") + } + // Get bigquery GCP client - gcpService, err := m.service(ctx) + gcpService, err := m.service(ctx, projectID) if err != nil { return nil, err } @@ -100,9 +106,9 @@ func (m *model) AdapterForURL(ctx context.Context, url string) (directbase.Adapt type Adapter struct { id *krm.BigQueryDatasetRef - gcpService *api.Service + gcpService *bigquery.Client desired *krm.BigQueryDataset - actual *api.Dataset + actual *bigquery.DatasetMetadata reader client.Reader } @@ -116,8 +122,8 @@ func (a *Adapter) Find(ctx context.Context) (bool, error) { if err != nil { return false, fmt.Errorf("failed to parse bigquery dataset full name, %w", err) } - datasetGetCall := a.gcpService.Datasets.Get(parent.ProjectID, datasetId) - datasetpb, err := datasetGetCall.Do() + dsHandler := a.gcpService.DatasetInProject(parent.ProjectID, datasetId) + datasetpb, err := dsHandler.Metadata(ctx) if err != nil { if direct.IsNotFound(err) { return false, nil @@ -134,13 +140,13 @@ func (a *Adapter) Create(ctx context.Context, createOp *directbase.CreateOperati log.V(2).Info("creating Dataset", "name", a.id.External) mapCtx := &direct.MapContext{} - desiredDataset := BigQueryDatasetSpec_ToAPI(mapCtx, &a.desired.Spec, a.desired.Name) + desiredDataset := BigQueryDatasetSpec_ToProto(mapCtx, &a.desired.Spec) desiredDataset.Labels = make(map[string]string) for k, v := range a.desired.GetObjectMeta().GetLabels() { desiredDataset.Labels[k] = v } desiredDataset.Labels["managed-by-cnrm"] = "true" - parent, _, err := krm.ParseBigQueryDatasetExternal(a.id.External) + parent, datasetId, err := krm.ParseBigQueryDatasetExternal(a.id.External) if err != nil { return fmt.Errorf("failed to parse bigquery dataset full name, %w", err) } @@ -150,17 +156,25 @@ func (a *Adapter) Create(ctx context.Context, createOp *directbase.CreateOperati if err != nil { return err } - desiredDataset.DefaultEncryptionConfiguration.KmsKeyName = kmsRef.External + desiredDataset.DefaultEncryptionConfig.KMSKeyName = kmsRef.External } - insertDatasetCall := a.gcpService.Datasets.Insert(parent.ProjectID, desiredDataset) - inserted, err := insertDatasetCall.Do() - if err != nil { - return fmt.Errorf("inserting Dataset %s: %w", a.id.External, err) + dsHandler := a.gcpService.DatasetInProject(parent.ProjectID, datasetId) + if err := dsHandler.Create(ctx, desiredDataset); err != nil { + return fmt.Errorf("Error creating Dataset %s: %w", a.id.External, err) } - log.V(2).Info("successfully inserted Dataset", "name", a.id.External) + log.V(2).Info("successfully created Dataset", "name", a.id.External) + // The bigquery go client Create() does not return the created dataset. + // Fetching the dataset metadata + createdMetadata, err := dsHandler.Metadata(ctx) + if err != nil { + if direct.IsNotFound(err) { + return nil + } + return fmt.Errorf("Error getting the created BigQueryDataset %q: %w", a.id.External, err) + } status := &krm.BigQueryDatasetStatus{} - status = BigQueryDatasetStatus_FromAPI(mapCtx, inserted) + status = BigQueryDatasetStatus_FromProto(mapCtx, createdMetadata) if mapCtx.Err() != nil { return mapCtx.Err() } @@ -177,91 +191,93 @@ func (a *Adapter) Update(ctx context.Context, updateOp *directbase.UpdateOperati // Convert KRM object to proto message desiredKRM := a.desired.DeepCopy() - desired := BigQueryDatasetSpec_ToAPI(mapCtx, &desiredKRM.Spec, desiredKRM.Name) + desired := BigQueryDatasetSpec_ToProto(mapCtx, &desiredKRM.Spec) if mapCtx.Err() != nil { return mapCtx.Err() } - - resource := clone.Clone(a.actual).(*api.Dataset) + resource := clone.Clone(a.actual).(*bigquery.DatasetMetadata) // Check for immutable fields - if desired.Location != "" && !reflect.DeepEqual(desired.Location, resource.Location) { + if desiredKRM.Spec.Location != nil && !reflect.DeepEqual(desired.Location, resource.Location) { return fmt.Errorf("BigQueryDataset %s/%s location cannot be changed, actual: %s, desired: %s", u.GetNamespace(), u.GetName(), resource.Location, desired.Location) } - // Find diff updateMask := &fieldmaskpb.FieldMask{} if !reflect.DeepEqual(desired.Description, resource.Description) { resource.Description = desired.Description updateMask.Paths = append(updateMask.Paths, "description") } - if !reflect.DeepEqual(desired.FriendlyName, resource.FriendlyName) { - resource.FriendlyName = desired.FriendlyName + if !reflect.DeepEqual(desired.Name, resource.Name) { + resource.Name = desired.Name updateMask.Paths = append(updateMask.Paths, "friendly_name") } - if !reflect.DeepEqual(desired.DefaultPartitionExpirationMs, resource.DefaultPartitionExpirationMs) { - resource.DefaultPartitionExpirationMs = desired.DefaultPartitionExpirationMs - updateMask.Paths = append(updateMask.Paths, "default_partition_expirationMs") + if !reflect.DeepEqual(desired.DefaultPartitionExpiration, resource.DefaultPartitionExpiration) { + resource.DefaultPartitionExpiration = desired.DefaultPartitionExpiration + updateMask.Paths = append(updateMask.Paths, "default_partition_expiration") } - if !reflect.DeepEqual(desired.DefaultTableExpirationMs, resource.DefaultTableExpirationMs) { - resource.DefaultTableExpirationMs = desired.DefaultTableExpirationMs - updateMask.Paths = append(updateMask.Paths, "default_table_expirationMs") + if !reflect.DeepEqual(desired.DefaultTableExpiration, resource.DefaultTableExpiration) { + resource.DefaultTableExpiration = desired.DefaultTableExpiration + updateMask.Paths = append(updateMask.Paths, "default_table_expiration") } if !reflect.DeepEqual(desired.DefaultCollation, resource.DefaultCollation) { resource.DefaultCollation = desired.DefaultCollation updateMask.Paths = append(updateMask.Paths, "default_collation") } - if desired.DefaultEncryptionConfiguration != nil && resource.DefaultEncryptionConfiguration != nil && !reflect.DeepEqual(desired.DefaultEncryptionConfiguration, resource.DefaultEncryptionConfiguration) { + if desired.DefaultEncryptionConfig != nil && resource.DefaultEncryptionConfig != nil && !reflect.DeepEqual(desired.DefaultEncryptionConfig, resource.DefaultEncryptionConfig) { // Resolve KMS key reference if a.desired.Spec.DefaultEncryptionConfiguration != nil { kmsRef, err := refs.ResolveKMSCryptoKeyRef(ctx, a.reader, a.desired, a.desired.Spec.DefaultEncryptionConfiguration.KmsKeyRef) if err != nil { return err } - desired.DefaultEncryptionConfiguration.KmsKeyName = kmsRef.External + desired.DefaultEncryptionConfig.KMSKeyName = kmsRef.External } - resource.DefaultEncryptionConfiguration.KmsKeyName = desired.DefaultEncryptionConfiguration.KmsKeyName + resource.DefaultEncryptionConfig.KMSKeyName = desired.DefaultEncryptionConfig.KMSKeyName updateMask.Paths = append(updateMask.Paths, "default_encryption_configuration") } if !reflect.DeepEqual(desired.IsCaseInsensitive, resource.IsCaseInsensitive) { resource.IsCaseInsensitive = desired.IsCaseInsensitive updateMask.Paths = append(updateMask.Paths, "is_case_sensitive") } - if !reflect.DeepEqual(desired.MaxTimeTravelHours, resource.MaxTimeTravelHours) { - resource.MaxTimeTravelHours = desired.MaxTimeTravelHours - updateMask.Paths = append(updateMask.Paths, "max_time_interval_hours") + // If we do not set a value, the GCP service defaults to 168 + // If the existing value is 168, it means that we did not set this field at creation and it defaults to 168. + // So if the desired value is 0, it means that we do not intend to update this field. + if !reflect.DeepEqual(desired.MaxTimeTravel, resource.MaxTimeTravel) && (resource.MaxTimeTravel != 168 && desired.MaxTimeTravel != 0) { + resource.MaxTimeTravel = desired.MaxTimeTravel + updateMask.Paths = append(updateMask.Paths, "max_time_travel") } if desired.Access != nil && resource.Access != nil && len(desired.Access) > 0 && !reflect.DeepEqual(desired.Access, resource.Access) { for _, access := range desired.Access { resource.Access = append(resource.Access, access) } - updateMask.Paths = append(updateMask.Paths, "access") } - if !reflect.DeepEqual(desired.StorageBillingModel, resource.StorageBillingModel) { - resource.StorageBillingModel = desired.StorageBillingModel - updateMask.Paths = append(updateMask.Paths, "storage_billing_model") - } - if len(updateMask.Paths) == 0 { return nil } + + // Get parent information parent, datasetId, err := krm.ParseBigQueryDatasetExternal(a.id.External) if err != nil { return fmt.Errorf("failed to parse bigquery dataset full name, %w", err) } - if desired.Access == nil || len(desired.Access) == 0 { - resource.Access = a.actual.Access + // Compute the dataset metadate for update request + datasetMetadataToUpdate := BigQueryDataset_ToMetadataToUpdate(mapCtx, resource, updateMask.Paths) + for k, v := range a.desired.GetObjectMeta().GetLabels() { + datasetMetadataToUpdate.SetLabel(k, v) } - updateDatasetCall := a.gcpService.Datasets.Update(parent.ProjectID, datasetId, resource) - updated, err := updateDatasetCall.Do() + datasetMetadataToUpdate.SetLabel("managed-by-cnrm", "true") + + // Call update + dsHandler := a.gcpService.DatasetInProject(parent.ProjectID, datasetId) + updated, err := dsHandler.Update(ctx, *datasetMetadataToUpdate, resource.ETag) if err != nil { return fmt.Errorf("updating Dataset %s: %w", a.id.External, err) } log.V(2).Info("successfully updated Dataset", "name", a.id.External) status := &krm.BigQueryDatasetStatus{} - status = BigQueryDatasetStatus_FromAPI(mapCtx, updated) + status = BigQueryDatasetStatus_FromProto(mapCtx, updated) if mapCtx.Err() != nil { return mapCtx.Err() } @@ -276,7 +292,7 @@ func (a *Adapter) Export(ctx context.Context) (*unstructured.Unstructured, error obj := &krm.BigQueryDataset{} mapCtx := &direct.MapContext{} - obj.Spec = direct.ValueOf(BigQueryDatasetSpec_FromAPI(mapCtx, a.actual)) + obj.Spec = direct.ValueOf(BigQueryDatasetSpec_FromProto(mapCtx, a.actual)) if mapCtx.Err() != nil { return nil, mapCtx.Err() } @@ -303,9 +319,8 @@ func (a *Adapter) Delete(ctx context.Context, deleteOp *directbase.DeleteOperati if err != nil { return false, fmt.Errorf("failed to parse bigquery dataset full name, %w", err) } - deleteDatasetCall := a.gcpService.Datasets.Delete(parent.ProjectID, datasetId) - err = deleteDatasetCall.Do() - if err != nil { + dsHandler := a.gcpService.DatasetInProject(parent.ProjectID, datasetId) + if err := dsHandler.DeleteWithContents(ctx); err != nil { return false, fmt.Errorf("deleting Dataset %s: %w", a.id.External, err) } log.V(2).Info("successfully deleted Dataset", "name", a.id.External) diff --git a/pkg/controller/direct/maputils.go b/pkg/controller/direct/maputils.go index 34ba5a03f5..fc09883996 100644 --- a/pkg/controller/direct/maputils.go +++ b/pkg/controller/direct/maputils.go @@ -334,3 +334,13 @@ func Int64Value_FromProto(mapCtx *MapContext, ts *wrapperspb.Int64Value) int64 { func Int64Value_ToProto(mapCtx *MapContext, s int64) *wrapperspb.Int64Value { return wrapperspb.Int64(s) } + +// Convert a number of milliseconds since the Unix epoch to a time.Time. +// Treat an input of zero specially: convert it to the zero time, +// rather than the start of the epoch. +func UnixMillisToTime(m int64) time.Time { + if m == 0 { + return time.Time{} + } + return time.Unix(0, m*1e6) +} diff --git a/pkg/test/resourcefixture/testdata/basic/bigquery/v1beta1/bigquerydataset/basicbigquerydataset-direct/_http.log b/pkg/test/resourcefixture/testdata/basic/bigquery/v1beta1/bigquerydataset/basicbigquerydataset-direct/_http.log index bd2610d99f..0b81cfbe32 100644 --- a/pkg/test/resourcefixture/testdata/basic/bigquery/v1beta1/bigquerydataset/basicbigquerydataset-direct/_http.log +++ b/pkg/test/resourcefixture/testdata/basic/bigquery/v1beta1/bigquerydataset/basicbigquerydataset-direct/_http.log @@ -150,8 +150,9 @@ X-Xss-Protection: 0 --- -PUT https://bigquery.googleapis.com/bigquery/v2/projects/${projectId}/datasets/${datasetID}?alt=json&prettyPrint=false +PATCH https://bigquery.googleapis.com/bigquery/v2/projects/${projectId}/datasets/${datasetID}?alt=json&prettyPrint=false Content-Type: application/json +If-Match: abcdef0123A= User-Agent: kcc/controller-manager { @@ -173,23 +174,12 @@ User-Agent: kcc/controller-manager "specialGroup": "projectWriters" } ], - "creationTime": "123456789", - "datasetReference": { - "datasetId": "bigquerydatasetsample${uniqueId}", - "projectId": "${projectId}" - }, - "etag": "abcdef0123A=", "friendlyName": "bigquerydataset-sample-updated", - "id": "000000000000000000000", - "kind": "bigquery#dataset", "labels": { "cnrm-test": "true", "managed-by-cnrm": "true" }, - "lastModifiedTime": "123456789", - "location": "US", - "selfLink": "https://bigquery.googleapis.com/bigquery/v2/projects/${projectId}/datasets/bigquerydatasetsample${uniqueId}", - "type": "DEFAULT" + "maxTimeTravelHours": "168" } 200 OK @@ -237,6 +227,7 @@ X-Xss-Protection: 0 }, "lastModifiedTime": "123456789", "location": "US", + "maxTimeTravelHours": "168", "selfLink": "https://bigquery.googleapis.com/bigquery/v2/projects/${projectId}/datasets/bigquerydatasetsample${uniqueId}", "type": "DEFAULT" } @@ -354,7 +345,7 @@ X-Xss-Protection: 0 --- -DELETE https://bigquery.googleapis.com/bigquery/v2/projects/${projectId}/datasets/${datasetID}?alt=json&prettyPrint=false +DELETE https://bigquery.googleapis.com/bigquery/v2/projects/${projectId}/datasets/${datasetID}?alt=json&deleteContents=true&prettyPrint=false User-Agent: kcc/controller-manager 204 No Content diff --git a/pkg/test/resourcefixture/testdata/basic/bigquery/v1beta1/bigquerydataset/bigquerydatasetaccessblock-direct/_http.log b/pkg/test/resourcefixture/testdata/basic/bigquery/v1beta1/bigquerydataset/bigquerydatasetaccessblock-direct/_http.log index 6dc0ad119f..959417f515 100644 --- a/pkg/test/resourcefixture/testdata/basic/bigquery/v1beta1/bigquerydataset/bigquerydatasetaccessblock-direct/_http.log +++ b/pkg/test/resourcefixture/testdata/basic/bigquery/v1beta1/bigquerydataset/bigquerydatasetaccessblock-direct/_http.log @@ -151,8 +151,9 @@ X-Xss-Protection: 0 --- -PUT https://bigquery.googleapis.com/bigquery/v2/projects/${projectId}/datasets/${datasetID}?alt=json&prettyPrint=false +PATCH https://bigquery.googleapis.com/bigquery/v2/projects/${projectId}/datasets/${datasetID}?alt=json&prettyPrint=false Content-Type: application/json +If-Match: abcdef0123A= User-Agent: kcc/controller-manager { @@ -178,25 +179,14 @@ User-Agent: kcc/controller-manager "specialGroup": "projectOwners" } ], - "creationTime": "123456789", - "datasetReference": { - "datasetId": "bigquerydataset${uniqueId}", - "projectId": "${projectId}" - }, "defaultTableExpirationMs": "7200000", "description": "BigQuery Dataset With Access Block v2", - "etag": "abcdef0123A=", "friendlyName": "bigquerydataset-accessblock", - "id": "000000000000000000000", - "kind": "bigquery#dataset", "labels": { "cnrm-test": "true", "managed-by-cnrm": "true" }, - "lastModifiedTime": "123456789", - "location": "US", - "selfLink": "https://bigquery.googleapis.com/bigquery/v2/projects/${projectId}/datasets/bigquerydataset${uniqueId}", - "type": "DEFAULT" + "maxTimeTravelHours": "168" } 200 OK @@ -250,6 +240,7 @@ X-Xss-Protection: 0 }, "lastModifiedTime": "123456789", "location": "US", + "maxTimeTravelHours": "168", "selfLink": "https://bigquery.googleapis.com/bigquery/v2/projects/${projectId}/datasets/bigquerydataset${uniqueId}", "type": "DEFAULT" } @@ -379,7 +370,7 @@ X-Xss-Protection: 0 --- -DELETE https://bigquery.googleapis.com/bigquery/v2/projects/${projectId}/datasets/${datasetID}?alt=json&prettyPrint=false +DELETE https://bigquery.googleapis.com/bigquery/v2/projects/${projectId}/datasets/${datasetID}?alt=json&deleteContents=true&prettyPrint=false User-Agent: kcc/controller-manager 204 No Content diff --git a/pkg/test/resourcefixture/testdata/basic/bigquery/v1beta1/bigquerydataset/fullybigquerydataset-direct/_http.log b/pkg/test/resourcefixture/testdata/basic/bigquery/v1beta1/bigquerydataset/fullybigquerydataset-direct/_http.log index a43788c8ec..9a5bdfb821 100644 --- a/pkg/test/resourcefixture/testdata/basic/bigquery/v1beta1/bigquerydataset/fullybigquerydataset-direct/_http.log +++ b/pkg/test/resourcefixture/testdata/basic/bigquery/v1beta1/bigquerydataset/fullybigquerydataset-direct/_http.log @@ -554,8 +554,9 @@ X-Xss-Protection: 0 --- -PUT https://bigquery.googleapis.com/bigquery/v2/projects/${projectId}/datasets/${datasetID}?alt=json&prettyPrint=false +PATCH https://bigquery.googleapis.com/bigquery/v2/projects/${projectId}/datasets/${datasetID}?alt=json&prettyPrint=false Content-Type: application/json +If-Match: abcdef0123A= User-Agent: kcc/controller-manager { @@ -577,31 +578,21 @@ User-Agent: kcc/controller-manager "userByEmail": "user@google.com" } ], - "creationTime": "123456789", - "datasetReference": { - "datasetId": "bigquerydataset${uniqueId}", - "projectId": "${projectId}" - }, + "defaultCollation": "", "defaultEncryptionConfiguration": { "kmsKeyName": "projects/${projectId}/locations/us/keyRings/kmskeyring-${uniqueId}/cryptoKeys/kmscryptokey-${uniqueId}" }, "defaultPartitionExpirationMs": "3800000", "defaultTableExpirationMs": "3800000", "description": "Fully Configured BigQuery Dataset updated", - "etag": "abcdef0123A=", "friendlyName": "bigquerydataset-fullyconfigured-updated", - "id": "000000000000000000000", - "kind": "bigquery#dataset", + "isCaseInsensitive": false, "labels": { "cnrm-test": "true", "managed-by-cnrm": "true" }, - "lastModifiedTime": "123456789", - "location": "US", "maxTimeTravelHours": "96", - "selfLink": "https://bigquery.googleapis.com/bigquery/v2/projects/${projectId}/datasets/bigquerydataset${uniqueId}", - "storageBillingModel": "LOGICAL", - "type": "DEFAULT" + "storageBillingModel": "LOGICAL" } 200 OK @@ -639,6 +630,7 @@ X-Xss-Protection: 0 "datasetId": "bigquerydataset${uniqueId}", "projectId": "${projectId}" }, + "defaultCollation": "", "defaultEncryptionConfiguration": { "kmsKeyName": "projects/${projectId}/locations/us/keyRings/kmskeyring-${uniqueId}/cryptoKeys/kmscryptokey-${uniqueId}" }, @@ -648,6 +640,7 @@ X-Xss-Protection: 0 "etag": "abcdef0123A=", "friendlyName": "bigquerydataset-fullyconfigured-updated", "id": "000000000000000000000", + "isCaseInsensitive": false, "kind": "bigquery#dataset", "labels": { "cnrm-test": "true", @@ -702,6 +695,7 @@ X-Xss-Protection: 0 "datasetId": "bigquerydataset${uniqueId}", "projectId": "${projectId}" }, + "defaultCollation": "", "defaultEncryptionConfiguration": { "kmsKeyName": "projects/${projectId}/locations/us/keyRings/kmskeyring-${uniqueId}/cryptoKeys/kmscryptokey-${uniqueId}" }, @@ -711,6 +705,7 @@ X-Xss-Protection: 0 "etag": "abcdef0123A=", "friendlyName": "bigquerydataset-fullyconfigured-updated", "id": "000000000000000000000", + "isCaseInsensitive": false, "kind": "bigquery#dataset", "labels": { "cnrm-test": "true", @@ -764,6 +759,7 @@ X-Xss-Protection: 0 "datasetId": "bigquerydataset${uniqueId}", "projectId": "${projectId}" }, + "defaultCollation": "", "defaultEncryptionConfiguration": { "kmsKeyName": "projects/${projectId}/locations/us/keyRings/kmskeyring-${uniqueId}/cryptoKeys/kmscryptokey-${uniqueId}" }, @@ -773,6 +769,7 @@ X-Xss-Protection: 0 "etag": "abcdef0123A=", "friendlyName": "bigquerydataset-fullyconfigured-updated", "id": "000000000000000000000", + "isCaseInsensitive": false, "kind": "bigquery#dataset", "labels": { "cnrm-test": "true", @@ -788,7 +785,7 @@ X-Xss-Protection: 0 --- -DELETE https://bigquery.googleapis.com/bigquery/v2/projects/${projectId}/datasets/${datasetID}?alt=json&prettyPrint=false +DELETE https://bigquery.googleapis.com/bigquery/v2/projects/${projectId}/datasets/${datasetID}?alt=json&deleteContents=true&prettyPrint=false User-Agent: kcc/controller-manager 204 No Content diff --git a/tests/e2e/unified_test.go b/tests/e2e/unified_test.go index 1048429f11..b8f475b4f8 100644 --- a/tests/e2e/unified_test.go +++ b/tests/e2e/unified_test.go @@ -672,6 +672,13 @@ func runScenario(ctx context.Context, t *testing.T, testPause bool, fixture reso } } }) + // Specific to BigQuery + addSetStringReplacement(".access[].userByEmail", "user@google.com") + for _, event := range events { + if event.Request.Method == "PATCH" && strings.Contains(event.Request.URL, "bigquery.googleapis.com/bigquery/v2/") { + event.Request.ReplaceHeader("If-Match", "abcdef0123A=") + } + } // Specific to BigTable addSetStringReplacement(".instances[].createTime", "2024-04-01T12:34:56.123456Z")