From feb8da7b0dc18a610fd5f03b3eeb42152a609217 Mon Sep 17 00:00:00 2001 From: shadialtarsha Date: Sun, 12 Jan 2025 13:42:12 +0100 Subject: [PATCH 01/17] An attempt to update controller-runtime to v0.19 --- go.mod | 82 ++--- go.sum | 174 +++++----- pkg/fsm/builder.go | 25 +- pkg/fsm/claim_builder.go | 18 +- pkg/fsm/handler/observed_event_handler.go | 26 +- .../handler/observed_event_handler_test.go | 45 +-- .../test/claim/test_claim_fsm_controller.go | 3 +- .../internal/test/core/test_fsm_reconciler.go | 2 +- pkg/fsm/test/chan/chan_test.go | 313 +++++++++--------- .../test/v1alpha1/zz_generated.deepcopy.go | 4 +- ...test.infrared.reddit.com_testclaimeds.yaml | 45 +-- .../test.infrared.reddit.com_testclaims.yaml | 51 +-- pkg/ratelimiter/ratelimit.go | 26 +- tools/go.mod | 91 +++-- tools/go.sum | 259 +++++++-------- 15 files changed, 573 insertions(+), 591 deletions(-) diff --git a/go.mod b/go.mod index 364c17d..459ed42 100644 --- a/go.mod +++ b/go.mod @@ -1,59 +1,59 @@ module github.com/reddit/achilles-sdk -go 1.22.5 +go 1.23.0 -toolchain go1.22.7 +toolchain go1.23.4 require ( - github.com/fgrosse/zaptest v1.1.0 + github.com/fgrosse/zaptest v1.2.1 github.com/go-logr/zapr v1.3.0 - github.com/gobuffalo/flect v0.3.0 + github.com/gobuffalo/flect v1.0.3 github.com/google/go-cmp v0.6.0 - github.com/iancoleman/strcase v0.2.0 - github.com/onsi/ginkgo/v2 v2.17.1 - github.com/onsi/gomega v1.32.0 - github.com/prometheus/client_golang v1.19.0 - github.com/prometheus/client_model v0.6.0 - github.com/reddit/achilles-sdk-api v1.1.0 + github.com/iancoleman/strcase v0.3.0 + github.com/onsi/ginkgo/v2 v2.22.2 + github.com/onsi/gomega v1.36.2 + github.com/prometheus/client_golang v1.20.5 + github.com/prometheus/client_model v0.6.1 + github.com/reddit/achilles-sdk-api v1.1.1 github.com/spf13/pflag v1.0.6-0.20210604193023-d5e0c0615ace - github.com/stretchr/testify v1.9.0 + github.com/stretchr/testify v1.10.0 go.uber.org/zap v1.27.0 - golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 - golang.org/x/sync v0.7.0 - golang.org/x/time v0.5.0 - golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d - k8s.io/api v0.29.3 - k8s.io/apiextensions-apiserver v0.29.3 - k8s.io/apimachinery v0.30.0 - k8s.io/client-go v0.29.3 - k8s.io/utils v0.0.0-20231127182322-b307cd553661 - sigs.k8s.io/controller-runtime v0.17.3 + golang.org/x/exp v0.0.0-20250106191152-7588d65b2ba8 + golang.org/x/sync v0.10.0 + golang.org/x/time v0.9.0 + golang.org/x/tools v0.29.0 + k8s.io/api v0.32.0 + k8s.io/apiextensions-apiserver v0.32.0 + k8s.io/apimachinery v0.32.0 + k8s.io/client-go v0.32.0 + k8s.io/utils v0.0.0-20241210054802-24370beab758 + sigs.k8s.io/controller-runtime v0.19.4 sigs.k8s.io/yaml v1.4.0 ) require ( github.com/beorn7/perks v1.0.1 // indirect - github.com/cespare/xxhash/v2 v2.2.0 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/emicklei/go-restful/v3 v3.11.0 // indirect github.com/evanphx/json-patch v5.7.0+incompatible // indirect github.com/evanphx/json-patch/v5 v5.9.0 // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/fxamacker/cbor/v2 v2.7.0 // indirect github.com/go-logr/logr v1.4.2 // indirect github.com/go-openapi/jsonpointer v0.21.0 // indirect github.com/go-openapi/jsonreference v0.21.0 // indirect github.com/go-openapi/swag v0.23.0 // indirect - github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect + github.com/go-task/slim-sprig/v3 v3.0.0 // indirect github.com/gogo/protobuf v1.3.2 // indirect - github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/protobuf v1.5.4 // indirect github.com/google/gnostic-models v0.6.8 // indirect github.com/google/gofuzz v1.2.0 // indirect - github.com/google/pprof v0.0.0-20240117000934-35fc243c5815 // indirect + github.com/google/pprof v0.0.0-20241210010833-40e02aabc2ad // indirect github.com/google/uuid v1.6.0 // indirect - github.com/imdario/mergo v0.3.16 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect + github.com/klauspost/compress v1.17.9 // indirect github.com/mailru/easyjson v0.7.7 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect @@ -61,23 +61,23 @@ require ( github.com/onsi/ginkgo v1.16.5 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect - github.com/prometheus/common v0.49.0 // indirect - github.com/prometheus/procfs v0.12.0 // indirect + github.com/prometheus/common v0.55.0 // indirect + github.com/prometheus/procfs v0.15.1 // indirect + github.com/x448/float16 v0.8.4 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/mod v0.17.0 // indirect - golang.org/x/net v0.27.0 // indirect - golang.org/x/oauth2 v0.21.0 // indirect - golang.org/x/sys v0.22.0 // indirect - golang.org/x/term v0.22.0 // indirect - golang.org/x/text v0.16.0 // indirect + golang.org/x/mod v0.22.0 // indirect + golang.org/x/net v0.34.0 // indirect + golang.org/x/oauth2 v0.23.0 // indirect + golang.org/x/sys v0.29.0 // indirect + golang.org/x/term v0.28.0 // indirect + golang.org/x/text v0.21.0 // indirect gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect - google.golang.org/protobuf v1.34.1 // indirect + google.golang.org/protobuf v1.36.1 // indirect + gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect - gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - k8s.io/component-base v0.29.3 // indirect - k8s.io/klog/v2 v2.120.1 // indirect - k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 // indirect - sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect - sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect + k8s.io/klog/v2 v2.130.1 // indirect + k8s.io/kube-openapi v0.0.0-20241105132330-32ad38e42d3f // indirect + sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3 // indirect + sigs.k8s.io/structured-merge-diff/v4 v4.4.2 // indirect ) diff --git a/go.sum b/go.sum index fb91ae5..997ad66 100644 --- a/go.sum +++ b/go.sum @@ -1,7 +1,7 @@ github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= -github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= @@ -12,12 +12,14 @@ github.com/evanphx/json-patch v5.7.0+incompatible h1:vgGkfT/9f8zE6tvSCe74nfpAVDQ github.com/evanphx/json-patch v5.7.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/evanphx/json-patch/v5 v5.9.0 h1:kcBlZQbplgElYIlo/n1hJbls2z/1awpXxpRi0/FOJfg= github.com/evanphx/json-patch/v5 v5.9.0/go.mod h1:VNkHZ/282BpEyt/tObQO8s5CMPmYYq14uClGH4abBuQ= -github.com/fgrosse/zaptest v1.1.0 h1:sK9hP0/xBoNX5qfFo3KWFluDXfc809APomI1QXuYELA= -github.com/fgrosse/zaptest v1.1.0/go.mod h1:vMnRSul6kW7kIUXZgnZZcDwyTn8k49ODfAULL8nmL5w= +github.com/fgrosse/zaptest v1.2.1 h1:QnbFHkIZcfICCzY1Grybxw9Em37RbGI6z5Lt6K/ROgw= +github.com/fgrosse/zaptest v1.2.1/go.mod h1:qc5bd351XNR70Wy4GZU0LS+OEHzA/IrF7vi6zOfQlf4= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= +github.com/fxamacker/cbor/v2 v2.7.0 h1:iM5WgngdRBanHcxugY4JySA0nk1wZorNOpTgCMedv5E= +github.com/fxamacker/cbor/v2 v2.7.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ= github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/zapr v1.3.0 h1:XGdV8XW8zdwFiwOA2Dryh1gj2KRQyOOoNmBy4EplIcQ= @@ -29,14 +31,12 @@ github.com/go-openapi/jsonreference v0.21.0/go.mod h1:LmZmgsrTkVg9LG4EaHeY8cBDsl github.com/go-openapi/swag v0.23.0 h1:vsEVJDUo2hPJ2tu0/Xc+4noaxyEffXNIs3cOULZ+GrE= github.com/go-openapi/swag v0.23.0/go.mod h1:esZ8ITTYEsH1V2trKHjAN8Ai7xHb8RV+YSZ577vPjgQ= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= -github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= -github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls= -github.com/gobuffalo/flect v0.3.0 h1:erfPWM+K1rFNIQeRPdeEXxo8yFr/PO17lhRnS8FUrtk= -github.com/gobuffalo/flect v0.3.0/go.mod h1:5pf3aGnsvqvCj50AVni7mJJF8ICxGZ8HomberC3pXLE= +github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= +github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= +github.com/gobuffalo/flect v1.0.3 h1:xeWBM2nui+qnVvNM4S3foBhCAL2XgPU+a7FdpelbTq4= +github.com/gobuffalo/flect v1.0.3/go.mod h1:A5msMlrHtLqh9umBSnvabjsMrCcCpAyzglnDvkbYKHs= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -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.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= @@ -57,25 +57,27 @@ github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeN github.com/google/gofuzz v1.0.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/pprof v0.0.0-20240117000934-35fc243c5815 h1:WzfWbQz/Ze8v6l++GGbGNFZnUShVpP/0xffCPLL+ax8= -github.com/google/pprof v0.0.0-20240117000934-35fc243c5815/go.mod h1:czg5+yv1E0ZGTi6S6vVK1mke0fV+FaUhNGcd6VRS9Ik= +github.com/google/pprof v0.0.0-20241210010833-40e02aabc2ad h1:a6HEuzUHeKH6hwfN/ZoQgRgVIWFJljSWa/zetS2WTvg= +github.com/google/pprof v0.0.0-20241210010833-40e02aabc2ad/go.mod h1:vavhavw2zAxS5dIdcRluK6cSGGPlZynqzFM8NdvU144= 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= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= -github.com/iancoleman/strcase v0.2.0 h1:05I4QRnGpI0m37iZQRuskXh+w77mr6Z41lwQzuHLwW0= -github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= -github.com/imdario/mergo v0.3.16 h1:wwQJbIsHYGMUyLSPrEq1CT16AhnhNJQ51+4fdHUnCl4= -github.com/imdario/mergo v0.3.16/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY= +github.com/iancoleman/strcase v0.3.0 h1:nTXanmYxhfFAMjZL34Ov6gkzEsSJZ5DbhxWjvSASxEI= +github.com/iancoleman/strcase v0.3.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= 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/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.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA= +github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= +github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -89,83 +91,79 @@ github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= -github.com/onsi/ginkgo/v2 v2.17.1 h1:V++EzdbhI4ZV4ev0UTIj0PzhzOcReJFyJaLjtSF55M8= -github.com/onsi/ginkgo/v2 v2.17.1/go.mod h1:llBI3WDLL9Z6taip6f33H76YcWtJv+7R3HigUjbIBOs= -github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/onsi/ginkgo/v2 v2.22.2 h1:/3X8Panh8/WwhU/3Ssa6rCKqPLuAkVY2I0RoyDLySlU= +github.com/onsi/ginkgo/v2 v2.22.2/go.mod h1:oeMosUL+8LtarXBHu/c0bx2D/K9zyQ6uX3cTyztHwsk= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= -github.com/onsi/gomega v1.32.0 h1:JRYU78fJ1LPxlckP6Txi/EYqJvjtMrDC04/MM5XRHPk= -github.com/onsi/gomega v1.32.0/go.mod h1:a4x4gW6Pz2yK1MAmvluYme5lvYTn61afQ2ETw/8n4Lg= -github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/onsi/gomega v1.36.2 h1:koNYke6TVk6ZmnyHrCXba/T/MoLBXFjeC1PtvYgw0A8= +github.com/onsi/gomega v1.36.2/go.mod h1:DdwyADRjrc825LhMEkD76cHR5+pUnjhUN8GlHlRPHzY= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v1.19.0 h1:ygXvpU1AoN1MhdzckN+PyD9QJOSD4x7kmXYlnfbA6JU= -github.com/prometheus/client_golang v1.19.0/go.mod h1:ZRM9uEAypZakd+q/x7+gmsvXdURP+DABIEIjnmDdp+k= -github.com/prometheus/client_model v0.6.0 h1:k1v3CzpSRUTrKMppY35TLwPvxHqBu0bYgxZzqGIgaos= -github.com/prometheus/client_model v0.6.0/go.mod h1:NTQHnmxFpouOD0DpvP4XujX3CdOAGQPoaGhyTchlyt8= -github.com/prometheus/common v0.49.0 h1:ToNTdK4zSnPVJmh698mGFkDor9wBI/iGaJy5dbH1EgI= -github.com/prometheus/common v0.49.0/go.mod h1:Kxm+EULxRbUkjGU6WFsQqo3ORzB4tyKvlWFOE9mB2sE= -github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= -github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= -github.com/reddit/achilles-sdk-api v1.1.0 h1:sbQv/qH/kaJU4UoAK7trZo76iA5zlgRpcbqGLcSCaNM= -github.com/reddit/achilles-sdk-api v1.1.0/go.mod h1:tKV9nH5k3TM5MGomS28JRzVyZ+yeJgdS2c5qMZe7fuI= -github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= -github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= +github.com/prometheus/client_golang v1.20.5 h1:cxppBPuYhUnsO6yo/aoRol4L7q7UFfdm+bR9r+8l63Y= +github.com/prometheus/client_golang v1.20.5/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= +github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= +github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= +github.com/prometheus/common v0.55.0 h1:KEi6DK7lXW/m7Ig5i47x0vRzuBsHuvJdi5ee6Y3G1dc= +github.com/prometheus/common v0.55.0/go.mod h1:2SECS4xJG1kd8XF9IcM1gMX6510RAEL65zxzNImwdc8= +github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= +github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= +github.com/reddit/achilles-sdk-api v1.1.1 h1:H8KmxA6nMgOhUjKnw3BgxqC0qft8+/I9ZobCDNgDPwA= +github.com/reddit/achilles-sdk-api v1.1.1/go.mod h1:tKV9nH5k3TM5MGomS28JRzVyZ+yeJgdS2c5qMZe7fuI= +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/spf13/pflag v1.0.6-0.20210604193023-d5e0c0615ace h1:9PNP1jnUjRhfmGMlkXHjYPishpcw4jpSt/V/xYY3FMA= github.com/spf13/pflag v1.0.6-0.20210604193023-d5e0c0615ace/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= -github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= +github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= -go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 h1:LfspQV/FYTatPTr/3HzIcmiUFH7PGP+OQ6mgDYo3yuQ= -golang.org/x/exp v0.0.0-20240222234643-814bf88cf225/go.mod h1:CxmFvTBINI24O/j8iY7H1xHzx2i4OsyguNBmN/uPtqc= +golang.org/x/exp v0.0.0-20250106191152-7588d65b2ba8 h1:yqrTHse8TCMW1M1ZCP+VAR/l0kKxwaAIqN/il7x4voA= +golang.org/x/exp v0.0.0-20250106191152-7588d65b2ba8/go.mod h1:tujkw807nyEEAamNbDrEGzRav+ilXA7PCRAd6xsmwiU= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA= -golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.22.0 h1:D4nJWe9zXqHOmWqj4VMOJhvzj7bEZg4wEYa759z1pH4= +golang.org/x/mod v0.22.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 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-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys= -golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE= -golang.org/x/oauth2 v0.21.0 h1:tsimM75w1tF/uws5rbeHzIWxEqElMehnc+iW793zsZs= -golang.org/x/oauth2 v0.21.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= +golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0= +golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k= +golang.org/x/oauth2 v0.23.0 h1:PbgcYx2W7i4LvjJWEbf0ngHV6qJYr86PkAV3bXdLEbs= +golang.org/x/oauth2 v0.23.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-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= -golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ= +golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -175,23 +173,23 @@ golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI= -golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/term v0.22.0 h1:BbsgPEJULsl2fV/AT3v15Mjva5yXKQDyKf+TbDz7QJk= -golang.org/x/term v0.22.0/go.mod h1:F3qCibpT5AMpCRfhfT53vVJwhLtIVHhB9XDjfFvnMI4= +golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU= +golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/term v0.28.0 h1:/Ts8HFuMR2E6IP/jlo7QVLZHggjKQbhu/7H0LJFr3Gg= +golang.org/x/term v0.28.0/go.mod h1:Sw/lC2IAUZ92udQNf3WodGtn4k/XoLyZoh8v/8uiwek= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= -golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= -golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= -golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= +golang.org/x/time v0.9.0 h1:EsRrnYcQiGH+5FfbgvV4AP7qEZstoyrHB0DzarOQ4ZY= +golang.org/x/time v0.9.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= 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.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -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.29.0 h1:Xx0h3TtM9rzQpQuR4dKLrdglAmCEN5Oi+P74JdhdzXE= +golang.org/x/tools v0.29.0/go.mod h1:KMQVMRsVxU6nHCFXrBPhDB8XncLNLM0lIy/F14RP588= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -204,47 +202,43 @@ google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQ google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= -google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.36.1 h1:yBPeRvTftaleIgM3PZ/WBIZ7XM/eEYAaEyCwvyjq/gk= +google.golang.org/protobuf v1.36.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/evanphx/json-patch.v4 v4.12.0 h1:n6jtcsulIzXPJaxegRbvFNNrZDjbij7ny3gmSPG+6V4= +gopkg.in/evanphx/json-patch.v4 v4.12.0/go.mod h1:p8EYWUEYMpynmqDbY58zCKCFZw8pRWMG4EsWvDvM72M= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= -gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -k8s.io/api v0.29.3 h1:2ORfZ7+bGC3YJqGpV0KSDDEVf8hdGQ6A03/50vj8pmw= -k8s.io/api v0.29.3/go.mod h1:y2yg2NTyHUUkIoTC+phinTnEa3KFM6RZ3szxt014a80= -k8s.io/apiextensions-apiserver v0.29.3 h1:9HF+EtZaVpFjStakF4yVufnXGPRppWFEQ87qnO91YeI= -k8s.io/apiextensions-apiserver v0.29.3/go.mod h1:po0XiY5scnpJfFizNGo6puNU6Fq6D70UJY2Cb2KwAVc= -k8s.io/apimachinery v0.30.0 h1:qxVPsyDM5XS96NIh9Oj6LavoVFYff/Pon9cZeDIkHHA= -k8s.io/apimachinery v0.30.0/go.mod h1:iexa2somDaxdnj7bha06bhb43Zpa6eWH8N8dbqVjTUc= -k8s.io/client-go v0.29.3 h1:R/zaZbEAxqComZ9FHeQwOh3Y1ZUs7FaHKZdQtIc2WZg= -k8s.io/client-go v0.29.3/go.mod h1:tkDisCvgPfiRpxGnOORfkljmS+UrW+WtXAy2fTvXJB0= -k8s.io/component-base v0.29.3 h1:Oq9/nddUxlnrCuuR2K/jp6aflVvc0uDvxMzAWxnGzAo= -k8s.io/component-base v0.29.3/go.mod h1:Yuj33XXjuOk2BAaHsIGHhCKZQAgYKhqIxIjIr2UXYio= -k8s.io/klog/v2 v2.120.1 h1:QXU6cPEOIslTGvZaXvFWiP9VKyeet3sawzTOvdXb4Vw= -k8s.io/klog/v2 v2.120.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= -k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 h1:BZqlfIlq5YbRMFko6/PM7FjZpUb45WallggurYhKGag= -k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340/go.mod h1:yD4MZYeKMBwQKVht279WycxKyM84kkAx2DPrTXaeb98= -k8s.io/utils v0.0.0-20231127182322-b307cd553661 h1:FepOBzJ0GXm8t0su67ln2wAZjbQ6RxQGZDnzuLcrUTI= -k8s.io/utils v0.0.0-20231127182322-b307cd553661/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= -sigs.k8s.io/controller-runtime v0.17.3 h1:65QmN7r3FWgTxDMz9fvGnO1kbf2nu+acg9p2R9oYYYk= -sigs.k8s.io/controller-runtime v0.17.3/go.mod h1:N0jpP5Lo7lMTF9aL56Z/B2oWBJjey6StQM0jRbKQXtY= -sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= -sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= -sigs.k8s.io/structured-merge-diff/v4 v4.4.1 h1:150L+0vs/8DA78h1u02ooW1/fFq/Lwr+sGiqlzvrtq4= -sigs.k8s.io/structured-merge-diff/v4 v4.4.1/go.mod h1:N8hJocpFajUSSeSJ9bOZ77VzejKZaXsTtZo4/u7Io08= +k8s.io/api v0.32.0 h1:OL9JpbvAU5ny9ga2fb24X8H6xQlVp+aJMFlgtQjR9CE= +k8s.io/api v0.32.0/go.mod h1:4LEwHZEf6Q/cG96F3dqR965sYOfmPM7rq81BLgsE0p0= +k8s.io/apiextensions-apiserver v0.32.0 h1:S0Xlqt51qzzqjKPxfgX1xh4HBZE+p8KKBq+k2SWNOE0= +k8s.io/apiextensions-apiserver v0.32.0/go.mod h1:86hblMvN5yxMvZrZFX2OhIHAuFIMJIZ19bTvzkP+Fmw= +k8s.io/apimachinery v0.32.0 h1:cFSE7N3rmEEtv4ei5X6DaJPHHX0C+upp+v5lVPiEwpg= +k8s.io/apimachinery v0.32.0/go.mod h1:GpHVgxoKlTxClKcteaeuF1Ul/lDVb74KpZcxcmLDElE= +k8s.io/client-go v0.32.0 h1:DimtMcnN/JIKZcrSrstiwvvZvLjG0aSxy8PxN8IChp8= +k8s.io/client-go v0.32.0/go.mod h1:boDWvdM1Drk4NJj/VddSLnx59X3OPgwrOo0vGbtq9+8= +k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= +k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= +k8s.io/kube-openapi v0.0.0-20241105132330-32ad38e42d3f h1:GA7//TjRY9yWGy1poLzYYJJ4JRdzg3+O6e8I+e+8T5Y= +k8s.io/kube-openapi v0.0.0-20241105132330-32ad38e42d3f/go.mod h1:R/HEjbvWI0qdfb8viZUeVZm0X6IZnxAydC7YU42CMw4= +k8s.io/utils v0.0.0-20241210054802-24370beab758 h1:sdbE21q2nlQtFh65saZY+rRM6x6aJJI8IUa1AmH/qa0= +k8s.io/utils v0.0.0-20241210054802-24370beab758/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= +sigs.k8s.io/controller-runtime v0.19.4 h1:SUmheabttt0nx8uJtoII4oIP27BVVvAKFvdvGFwV/Qo= +sigs.k8s.io/controller-runtime v0.19.4/go.mod h1:iRmWllt8IlaLjvTTDLhRBXIEtkCK6hwVBJJsYS9Ajf4= +sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3 h1:/Rv+M11QRah1itp8VhT6HoVx1Ray9eB4DBr+K+/sCJ8= +sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3/go.mod h1:18nIHnGi6636UCz6m8i4DhaJ65T6EruyzmoQqI2BVDo= +sigs.k8s.io/structured-merge-diff/v4 v4.4.2 h1:MdmvkGuXi/8io6ixD5wud3vOLwc1rj0aNqRlpuvjmwA= +sigs.k8s.io/structured-merge-diff/v4 v4.4.2/go.mod h1:N8f93tFZh9U6vpxwRArLiikrE5/2tiu1w1AGfACIGE4= sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= diff --git a/pkg/fsm/builder.go b/pkg/fsm/builder.go index a7f893b..e8f4ada 100644 --- a/pkg/fsm/builder.go +++ b/pkg/fsm/builder.go @@ -14,6 +14,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/controller" "sigs.k8s.io/controller-runtime/pkg/handler" "sigs.k8s.io/controller-runtime/pkg/predicate" + "sigs.k8s.io/controller-runtime/pkg/reconcile" "sigs.k8s.io/controller-runtime/pkg/source" apitypes "github.com/reddit/achilles-sdk-api/pkg/types" @@ -30,7 +31,7 @@ import ( type SetupFunc func( ctrl.Manager, // controller-runtime manager *zap.SugaredLogger, // logger - workqueue.RateLimiter, // reconciler rate limiter + workqueue.TypedRateLimiter[reconcile.Request], // reconciler rate limiter *metrics.Metrics, // metrics sink ) error @@ -176,7 +177,7 @@ func (b *Builder[T, Obj]) Build() SetupFunc { return func( mgr ctrl.Manager, log *zap.SugaredLogger, - rl workqueue.RateLimiter, + rl workqueue.TypedRateLimiter[reconcile.Request], metrics *metrics.Metrics, ) error { scheme := mgr.GetScheme() @@ -223,20 +224,16 @@ func (b *Builder[T, Obj]) Build() SetupFunc { } // wire up custom watches - for _, watch := range b.watches { + for _, w := range b.watches { builder.Watches( - watch.object, - fsmhandler.NewObservedEventHandler(log, scheme, name, metrics, watch.handler, watch.triggerType), - watch.opts..., + w.object, + fsmhandler.NewObservedEventHandler(log, scheme, name, metrics, w.handler, w.triggerType), + w.opts..., ) } - for _, watch := range b.watchesRawSource { - builder.WatchesRawSource( - watch.src, - fsmhandler.NewObservedEventHandler(log, scheme, name, metrics, watch.handler, watch.triggerType), - watch.opts..., - ) + for _, w := range b.watchesRawSource { + builder.WatchesRawSource(w.src) } // custom controller builder options @@ -244,14 +241,14 @@ func (b *Builder[T, Obj]) Build() SetupFunc { opt(builder) } - controller, err := builder.Build(r) + con, err := builder.Build(r) if err != nil { return fmt.Errorf("initializing controller: %w", err) } // controller functions for _, fn := range b.controllerFns { - fn(controller) + fn(con) } return nil diff --git a/pkg/fsm/claim_builder.go b/pkg/fsm/claim_builder.go index 8d03d79..4d47881 100644 --- a/pkg/fsm/claim_builder.go +++ b/pkg/fsm/claim_builder.go @@ -149,7 +149,7 @@ func (b *ClaimBuilder[T, U, ClaimedType, ClaimType]) Build() SetupFunc { return func( mgr ctrl.Manager, log *zap.SugaredLogger, - rl workqueue.RateLimiter, + rl workqueue.TypedRateLimiter[reconcile.Request], metrics *metrics.Metrics, ) error { objGVK := meta.MustTypedObjectRefFromObject(b.obj, mgr.GetScheme()) @@ -253,20 +253,16 @@ func (b *ClaimBuilder[T, U, ClaimedType, ClaimType]) Build() SetupFunc { } // wire up custom watches to claimed - for _, watch := range b.watches { + for _, w := range b.watches { claimedBuilder.Watches( - watch.object, - fsmhandler.NewObservedEventHandler(log, scheme, name, metrics, watch.handler, watch.triggerType), - watch.opts..., + w.object, + fsmhandler.NewObservedEventHandler(log, scheme, name, metrics, w.handler, w.triggerType), + w.opts..., ) } - for _, watch := range b.watchesRawSource { - claimedBuilder.WatchesRawSource( - watch.src, - fsmhandler.NewObservedEventHandler(log, scheme, name, metrics, watch.handler, watch.triggerType), - watch.opts..., - ) + for _, w := range b.watchesRawSource { + claimedBuilder.WatchesRawSource(w.src) } // custom controller builder options diff --git a/pkg/fsm/handler/observed_event_handler.go b/pkg/fsm/handler/observed_event_handler.go index d2d16e4..afe89b3 100644 --- a/pkg/fsm/handler/observed_event_handler.go +++ b/pkg/fsm/handler/observed_event_handler.go @@ -32,7 +32,7 @@ type ObservedEventHandler struct { } type observedQueue struct { - workqueue.RateLimitingInterface + workqueue.TypedRateLimitingInterface[reconcile.Request] handler *ObservedEventHandler eventType string triggerRef types.NamespacedName @@ -62,43 +62,41 @@ func NewObservedEventHandler( } } -func (h *ObservedEventHandler) Create(ctx context.Context, evt event.CreateEvent, q workqueue.RateLimitingInterface) { +func (h *ObservedEventHandler) Create(ctx context.Context, evt event.CreateEvent, q workqueue.TypedRateLimitingInterface[reconcile.Request]) { h.handler.Create(ctx, evt, h.observedQueue("create", evt.Object, q)) } -func (h *ObservedEventHandler) Update(ctx context.Context, evt event.UpdateEvent, q workqueue.RateLimitingInterface) { +func (h *ObservedEventHandler) Update(ctx context.Context, evt event.UpdateEvent, q workqueue.TypedRateLimitingInterface[reconcile.Request]) { h.handler.Update(ctx, evt, h.observedQueue("update", evt.ObjectNew, q)) } -func (h *ObservedEventHandler) Delete(ctx context.Context, evt event.DeleteEvent, q workqueue.RateLimitingInterface) { +func (h *ObservedEventHandler) Delete(ctx context.Context, evt event.DeleteEvent, q workqueue.TypedRateLimitingInterface[reconcile.Request]) { h.handler.Delete(ctx, evt, h.observedQueue("delete", evt.Object, q)) } -func (h *ObservedEventHandler) Generic(ctx context.Context, evt event.GenericEvent, q workqueue.RateLimitingInterface) { +func (h *ObservedEventHandler) Generic(ctx context.Context, evt event.GenericEvent, q workqueue.TypedRateLimitingInterface[reconcile.Request]) { h.handler.Generic(ctx, evt, h.observedQueue("generic", evt.Object, q)) } func (h *ObservedEventHandler) observedQueue( eventType string, trigger client.Object, - q workqueue.RateLimitingInterface, + q workqueue.TypedRateLimitingInterface[reconcile.Request], ) *observedQueue { // trigger client.Object return &observedQueue{ - RateLimitingInterface: q, - handler: h, - eventType: eventType, + TypedRateLimitingInterface: q, + handler: h, + eventType: eventType, // ref to the object being reconciled (which may differ from the triggering object for owner ref based triggers) triggerRef: client.ObjectKeyFromObject(trigger), triggerGVK: libmeta.MustGVKForObject(trigger, h.scheme), } } -func (q observedQueue) Add(item interface{}) { - if req, ok := item.(reconcile.Request); ok { - q.observeEvent(req) - } - q.RateLimitingInterface.Add(item) +func (q *observedQueue) Add(item reconcile.Request) { + q.observeEvent(item) + q.TypedRateLimitingInterface.AddRateLimited(item) } // logs an event trigger diff --git a/pkg/fsm/handler/observed_event_handler_test.go b/pkg/fsm/handler/observed_event_handler_test.go index 2c0a189..aaae39f 100644 --- a/pkg/fsm/handler/observed_event_handler_test.go +++ b/pkg/fsm/handler/observed_event_handler_test.go @@ -9,7 +9,7 @@ import ( "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "github.com/prometheus/client_golang/prometheus" - io_prometheus_client "github.com/prometheus/client_model/go" + ioprometheusclient "github.com/prometheus/client_model/go" "github.com/stretchr/testify/assert" "go.uber.org/zap" "go.uber.org/zap/zapcore" @@ -29,6 +29,7 @@ import ( fsmhandler "github.com/reddit/achilles-sdk/pkg/fsm/handler" "github.com/reddit/achilles-sdk/pkg/fsm/metrics" internalscheme "github.com/reddit/achilles-sdk/pkg/internal/scheme" + "github.com/reddit/achilles-sdk/pkg/ratelimiter" ) const controllerName = "test" @@ -42,7 +43,7 @@ func TestObserveEnqueueOwner(t *testing.T) { cases := []struct { name string expectedLogs []expectedLog - expectedMetricLabelValues [][]*io_prometheus_client.LabelPair + expectedMetricLabelValues [][]*ioprometheusclient.LabelPair expectedMetricValues []*float64 isController bool o client.Object @@ -88,7 +89,7 @@ func TestObserveEnqueueOwner(t *testing.T) { }, }, }, - expectedMetricLabelValues: [][]*io_prometheus_client.LabelPair{ + expectedMetricLabelValues: [][]*ioprometheusclient.LabelPair{ { newLabelPair("group", ""), newLabelPair("version", "v1"), @@ -155,7 +156,7 @@ func TestObserveEnqueueOwner(t *testing.T) { }, }, }, - expectedMetricLabelValues: [][]*io_prometheus_client.LabelPair{ + expectedMetricLabelValues: [][]*ioprometheusclient.LabelPair{ { newLabelPair("group", ""), newLabelPair("version", "v1"), @@ -214,7 +215,7 @@ func TestObserveEnqueueOwner(t *testing.T) { observedZapCore, observedLogs := observer.New(zap.DebugLevel) log := zap.New(observedZapCore).Sugar() reg := prometheus.NewRegistry() - metrics := metrics.MustMakeMetrics(scheme, reg) + m := metrics.MustMakeMetrics(scheme, reg) var h *fsmhandler.ObservedEventHandler if tc.isController { @@ -222,7 +223,7 @@ func TestObserveEnqueueOwner(t *testing.T) { log, scheme, controllerName, - metrics, + m, handler.EnqueueRequestForOwner(scheme, testrestmapper.TestOnlyStaticRESTMapper(scheme), &corev1.ConfigMap{}, handler.OnlyControllerOwner()), fsmhandler.TriggerTypeChild, ) @@ -231,14 +232,14 @@ func TestObserveEnqueueOwner(t *testing.T) { log, scheme, controllerName, - metrics, + m, handler.EnqueueRequestForOwner(scheme, testrestmapper.TestOnlyStaticRESTMapper(scheme), &corev1.ConfigMap{}), fsmhandler.TriggerTypeChild, ) } t.Run(tc.name, func(t *testing.T) { - queue := workqueue.NewRateLimitingQueue(workqueue.DefaultControllerRateLimiter()) + queue := workqueue.NewTypedRateLimitingQueue(ratelimiter.NewZeroDelayManagedRateLimiter(ratelimiter.NewGlobal(1))) h.Create(context.TODO(), event.CreateEvent{Object: tc.o}, queue) assertExpectedLogMessages(t, tc.expectedLogs, observedLogs) assertExpectedCounterMetrics(t, reg, tc.expectedMetricLabelValues, tc.expectedMetricValues, "achilles_trigger") @@ -252,7 +253,7 @@ func TestObserveEnqueueMapped(t *testing.T) { name string expected []expectedLog o client.Object - expectedMetricLabelValues [][]*io_prometheus_client.LabelPair + expectedMetricLabelValues [][]*ioprometheusclient.LabelPair expectedMetricValues []*float64 reqs []reconcile.Request }{ @@ -286,7 +287,7 @@ func TestObserveEnqueueMapped(t *testing.T) { }, }, }, - expectedMetricLabelValues: [][]*io_prometheus_client.LabelPair{ + expectedMetricLabelValues: [][]*ioprometheusclient.LabelPair{ { newLabelPair("group", "apps"), newLabelPair("version", "v1"), @@ -344,19 +345,19 @@ func TestObserveEnqueueMapped(t *testing.T) { observedZapCore, observedLogs := observer.New(zap.DebugLevel) log := zap.New(observedZapCore).Sugar() reg := prometheus.NewRegistry() - metrics := metrics.MustMakeMetrics(scheme, reg) + m := metrics.MustMakeMetrics(scheme, reg) h := fsmhandler.NewObservedEventHandler( log, scheme, controllerName, - metrics, + m, handler.EnqueueRequestsFromMapFunc(func(ctx context.Context, object client.Object) []reconcile.Request { return tc.reqs }), fsmhandler.TriggerTypeRelative, ) t.Run(tc.name, func(t *testing.T) { - queue := workqueue.NewRateLimitingQueue(workqueue.DefaultControllerRateLimiter()) + queue := workqueue.NewTypedRateLimitingQueue(ratelimiter.NewZeroDelayManagedRateLimiter(ratelimiter.NewGlobal(1))) h.Create(context.TODO(), event.CreateEvent{Object: tc.o}, queue) assertExpectedLogMessages(t, tc.expected, observedLogs) assertExpectedCounterMetrics(t, reg, tc.expectedMetricLabelValues, tc.expectedMetricValues, "achilles_trigger") @@ -369,7 +370,7 @@ func TestObserveEnqueueObject(t *testing.T) { cases := []struct { name string expected []expectedLog - expectedMetricLabelValues [][]*io_prometheus_client.LabelPair + expectedMetricLabelValues [][]*ioprometheusclient.LabelPair expectedMetricValues []*float64 o client.Object }{ @@ -385,7 +386,7 @@ func TestObserveEnqueueObject(t *testing.T) { }, }, }, - expectedMetricLabelValues: [][]*io_prometheus_client.LabelPair{ + expectedMetricLabelValues: [][]*ioprometheusclient.LabelPair{ { newLabelPair("group", ""), newLabelPair("version", "v1"), @@ -417,13 +418,13 @@ func TestObserveEnqueueObject(t *testing.T) { observedZapCore, observedLogs := observer.New(zap.DebugLevel) log := zap.New(observedZapCore).Sugar() reg := prometheus.NewRegistry() - metrics := metrics.MustMakeMetrics(scheme, reg) + m := metrics.MustMakeMetrics(scheme, reg) h := fsmhandler.NewForObservePredicate( log, scheme, controllerName, - metrics, + m, ) t.Run(tc.name, func(t *testing.T) { @@ -472,7 +473,7 @@ func extractLogStringPairs(fields []zapcore.Field) map[string]string { func assertExpectedCounterMetrics( t *testing.T, reg *prometheus.Registry, - expectedMetricLabelValues [][]*io_prometheus_client.LabelPair, + expectedMetricLabelValues [][]*ioprometheusclient.LabelPair, expectedMetricValues []*float64, expectedMetricName string, ) { @@ -481,7 +482,7 @@ func assertExpectedCounterMetrics( t.Fatalf("gathering metrics: %s", err.Error()) } - var metrics []*io_prometheus_client.Metric + var metrics []*ioprometheusclient.Metric for _, metricFamily := range metricFamilies { if metricFamily != nil && *metricFamily.Name == expectedMetricName { metrics = metricFamily.Metric @@ -509,14 +510,14 @@ func assertExpectedCounterMetrics( t.Errorf("unexpected metric value (-got +want):\n%s", diff) } - if diff := cmp.Diff(expectedLabelValues, metric.Label, cmpopts.IgnoreUnexported(io_prometheus_client.LabelPair{}), cmpopts.SortSlices(func(a, b *io_prometheus_client.LabelPair) bool { return *a.Name < *b.Name })); diff != "" { + if diff := cmp.Diff(expectedLabelValues, metric.Label, cmpopts.IgnoreUnexported(ioprometheusclient.LabelPair{}), cmpopts.SortSlices(func(a, b *ioprometheusclient.LabelPair) bool { return *a.Name < *b.Name })); diff != "" { t.Errorf("unexpected metric value (-got +want):\n%s", diff) } } } -func newLabelPair(name, value string) *io_prometheus_client.LabelPair { - return &io_prometheus_client.LabelPair{ +func newLabelPair(name, value string) *ioprometheusclient.LabelPair { + return &ioprometheusclient.LabelPair{ Name: ptr.To(name), Value: ptr.To(value), } diff --git a/pkg/fsm/internal/test/claim/test_claim_fsm_controller.go b/pkg/fsm/internal/test/claim/test_claim_fsm_controller.go index ac11ec4..d740516 100644 --- a/pkg/fsm/internal/test/claim/test_claim_fsm_controller.go +++ b/pkg/fsm/internal/test/claim/test_claim_fsm_controller.go @@ -8,6 +8,7 @@ import ( corev1 "k8s.io/api/core/v1" "k8s.io/client-go/util/workqueue" ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/reconcile" "github.com/reddit/achilles-sdk-api/api" "github.com/reddit/achilles-sdk/pkg/fsm" @@ -27,7 +28,7 @@ type reconciler struct { func setupTestClaimController( log *zap.SugaredLogger, mgr ctrl.Manager, - rl workqueue.RateLimiter, + rl workqueue.TypedRateLimiter[reconcile.Request], c *io.ClientApplicator, metrics *metrics.Metrics, ) error { diff --git a/pkg/fsm/internal/test/core/test_fsm_reconciler.go b/pkg/fsm/internal/test/core/test_fsm_reconciler.go index 0546f37..bb2a91a 100644 --- a/pkg/fsm/internal/test/core/test_fsm_reconciler.go +++ b/pkg/fsm/internal/test/core/test_fsm_reconciler.go @@ -44,7 +44,7 @@ const ( func SetupController( log *zap.SugaredLogger, mgr ctrl.Manager, - rl workqueue.RateLimiter, + rl workqueue.TypedRateLimiter[reconcile.Request], c *io.ClientApplicator, metrics *metrics.Metrics, disableAutoCreate *atomic.Bool, diff --git a/pkg/fsm/test/chan/chan_test.go b/pkg/fsm/test/chan/chan_test.go index 3117a9f..abb4d2f 100644 --- a/pkg/fsm/test/chan/chan_test.go +++ b/pkg/fsm/test/chan/chan_test.go @@ -1,167 +1,150 @@ package fsm_test -import ( - "context" - "fmt" - "path/filepath" - "sync/atomic" - "testing" - "time" - - "github.com/fgrosse/zaptest" - . "github.com/onsi/ginkgo/v2" - . "github.com/onsi/gomega" - "github.com/prometheus/client_golang/prometheus" - "go.uber.org/zap" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/event" - "sigs.k8s.io/controller-runtime/pkg/handler" - "sigs.k8s.io/controller-runtime/pkg/manager" - "sigs.k8s.io/controller-runtime/pkg/source" - - "github.com/reddit/achilles-sdk/pkg/fsm" - fsmhandler "github.com/reddit/achilles-sdk/pkg/fsm/handler" - "github.com/reddit/achilles-sdk/pkg/fsm/metrics" - fsmtypes "github.com/reddit/achilles-sdk/pkg/fsm/types" - internalscheme "github.com/reddit/achilles-sdk/pkg/internal/scheme" - "github.com/reddit/achilles-sdk/pkg/internal/tests" - "github.com/reddit/achilles-sdk/pkg/internal/tests/api/test/v1alpha1" - "github.com/reddit/achilles-sdk/pkg/io" - "github.com/reddit/achilles-sdk/pkg/logging" - libratelimiter "github.com/reddit/achilles-sdk/pkg/ratelimiter" - "github.com/reddit/achilles-sdk/pkg/test" -) - -type state = fsmtypes.State[*v1alpha1.TestClaimed] - -func TestClaimControllerEnvtestIT(t *testing.T) { - RegisterFailHandler(Fail) - RunSpecs(t, "Claim Controller Suite") -} - -const ( - externalDataAnnotation = "test-annotation" -) - -var ( - // External data is written to claimed's annotations. - // srcChan is used to trigger reconciliation when externalData changes - externalData = "version_1" -) - -type reconciler struct { - log *zap.SugaredLogger - c *io.ClientApplicator - - lastReconcileAt atomic.Value -} - -func (r *reconciler) initialState() *state { - return &state{ - Name: "initial", - Transition: func( - ctx context.Context, - claimed *v1alpha1.TestClaimed, - out *fsmtypes.OutputSet, - ) (*state, fsmtypes.Result) { - r.lastReconcileAt.Store(time.Now()) - if claimed.Annotations == nil { - claimed.Annotations = make(map[string]string) - } - claimed.Annotations[externalDataAnnotation] = externalData - if err := r.c.Update(ctx, claimed); err != nil { - return nil, fsmtypes.ErrorResult(fmt.Errorf("updating status: %w", err)) - } - return nil, fsmtypes.DoneResult() - }, - } -} - -var _ = Describe("Claim Controller", func() { - - It("watches raw sources", func(gctx context.Context) { - log := zaptest.LoggerWriter(GinkgoWriter).Sugar() - ctx := logging.NewContext(gctx, log) - scheme := internalscheme.MustNewScheme() - - srcChan := make(chan event.GenericEvent, 10) - - var r *reconciler - - testEnv, err := test.NewEnvTestBuilder(ctx). - WithCRDDirectoryPaths([]string{ - filepath.Join(tests.RootDir(), "pkg", "internal", "tests", "cluster", "crd", "bases"), - }). - WithScheme(scheme). - WithLog(log.Desugar()). - WithManagerSetupFns( - func(mgr manager.Manager) error { - r = &reconciler{ - log: log, - c: &io.ClientApplicator{ - Client: mgr.GetClient(), - Applicator: io.NewAPIPatchingApplicator(mgr.GetClient()), - }, - lastReconcileAt: atomic.Value{}, - } - - builder := fsm.NewClaimBuilder( - &v1alpha1.TestClaimed{}, - &v1alpha1.TestClaim{}, - r.initialState(), - mgr.GetScheme(), - ).WatchesRawSource( - &source.Channel{Source: srcChan}, - &handler.EnqueueRequestForObject{}, - fsmhandler.TriggerTypeSelf, - ) - - rl := libratelimiter.NewDefaultProviderRateLimiter(libratelimiter.DefaultProviderRPS) - reg := prometheus.NewRegistry() - metrics := metrics.MustMakeMetrics(scheme, reg) - return builder.Build()(mgr, log, rl, metrics) - }, - ). - Start() - Expect(err).ToNot(HaveOccurred()) - defer func() { Expect(testEnv.Stop()).To(Succeed()) }() - c := testEnv.Client - - claim := &v1alpha1.TestClaim{} - claim.Name = "test-claim" - claim.Namespace = "default" - Expect(c.Create(ctx, claim)).To(Succeed()) - - By("Waiting for claimed") - claimed := &v1alpha1.TestClaimed{} - Eventually(func(g Gomega) { - actualClaim := &v1alpha1.TestClaim{} - g.Expect(c.Get(ctx, client.ObjectKeyFromObject(claim), actualClaim)).ToNot(HaveOccurred()) - g.Expect(actualClaim.Spec.ClaimedRef).ToNot(BeNil()) - g.Expect(c.Get(ctx, actualClaim.Spec.ClaimedRef.ObjectKey(), claimed)).ToNot(HaveOccurred()) - g.Expect(claimed.Annotations[externalDataAnnotation]).To(Equal("version_1")) - }).WithTimeout(1 * time.Second).Should(Succeed()) - - By("Making sure reconciliations finished") - Eventually(func(g Gomega) { - g.Expect(r.lastReconcileAt.Load().(time.Time)). - To(BeTemporally("<=", time.Now().Add(-1*time.Second))) - }).WithTimeout(3 * time.Second).Should(Succeed()) - - By("Updating external data and making sure reconciliation is not triggered") - claimed = claimed.DeepCopy() // avoid race - externalData = "version_2" - Consistently(func(g Gomega) { - g.Expect(c.Get(ctx, client.ObjectKeyFromObject(claimed), claimed)).ToNot(HaveOccurred()) - g.Expect(claimed.Annotations[externalDataAnnotation]).To(Equal("version_1")) - }).WithTimeout(1 * time.Second).Should(Succeed()) - - By("Triggering reconciliation via events channel") - claimed = claimed.DeepCopy() // avoid race - srcChan <- event.GenericEvent{Object: claimed} - Eventually(func(g Gomega) { - g.Expect(c.Get(ctx, client.ObjectKeyFromObject(claimed), claimed)).ToNot(HaveOccurred()) - g.Expect(claimed.Annotations[externalDataAnnotation]).To(Equal("version_2")) - }).WithTimeout(1 * time.Second).Should(Succeed()) - }) -}) +//import ( +// "context" +// "fmt" +// "sync/atomic" +// "testing" +// "time" +// +// . "github.com/onsi/ginkgo/v2" +// . "github.com/onsi/gomega" +// fsmtypes "github.com/reddit/achilles-sdk/pkg/fsm/types" +// "github.com/reddit/achilles-sdk/pkg/internal/tests/api/test/v1alpha1" +// "github.com/reddit/achilles-sdk/pkg/io" +// "go.uber.org/zap" +//) +// +//type state = fsmtypes.State[*v1alpha1.TestClaimed] +// +//func TestClaimControllerEnvtestIT(t *testing.T) { +// RegisterFailHandler(Fail) +// RunSpecs(t, "Claim Controller Suite") +//} +// +//const ( +// externalDataAnnotation = "test-annotation" +//) +// +//var ( +// // External data is written to claimed's annotations. +// // srcChan is used to trigger reconciliation when externalData changes +// externalData = "version_1" +//) +// +//type reconciler struct { +// log *zap.SugaredLogger +// c *io.ClientApplicator +// +// lastReconcileAt atomic.Value +//} +// +//func (r *reconciler) initialState() *state { +// return &state{ +// Name: "initial", +// Transition: func( +// ctx context.Context, +// claimed *v1alpha1.TestClaimed, +// out *fsmtypes.OutputSet, +// ) (*state, fsmtypes.Result) { +// r.lastReconcileAt.Store(time.Now()) +// if claimed.Annotations == nil { +// claimed.Annotations = make(map[string]string) +// } +// claimed.Annotations[externalDataAnnotation] = externalData +// if err := r.c.Update(ctx, claimed); err != nil { +// return nil, fsmtypes.ErrorResult(fmt.Errorf("updating status: %w", err)) +// } +// return nil, fsmtypes.DoneResult() +// }, +// } +//} +// +//var _ = Describe("Claim Controller", func() { +// +//It("watches raw sources", func(gctx context.Context) { +// log := zaptest.LoggerWriter(GinkgoWriter).Sugar() +// ctx := logging.NewContext(gctx, log) +// scheme := internalscheme.MustNewScheme() +// +// srcChan := make(chan event.GenericEvent, 10) +// +// var r *reconciler +// +// testEnv, err := test.NewEnvTestBuilder(ctx). +// WithCRDDirectoryPaths([]string{ +// filepath.Join(tests.RootDir(), "pkg", "internal", "tests", "cluster", "crd", "bases"), +// }). +// WithScheme(scheme). +// WithLog(log.Desugar()). +// WithManagerSetupFns( +// func(mgr manager.Manager) error { +// r = &reconciler{ +// log: log, +// c: &io.ClientApplicator{ +// Client: mgr.GetClient(), +// Applicator: io.NewAPIPatchingApplicator(mgr.GetClient()), +// }, +// lastReconcileAt: atomic.Value{}, +// } +// +// builder := fsm.NewClaimBuilder( +// &v1alpha1.TestClaimed{}, +// &v1alpha1.TestClaim{}, +// r.initialState(), +// mgr.GetScheme(), +// ).WatchesRawSource( +// source.Channel(srcChan, &handler.EnqueueRequestForObject{}), +// &handler.EnqueueRequestForObject{}, +// fsmhandler.TriggerTypeSelf, +// ) +// +// rl := libratelimiter.NewDefaultProviderRateLimiter(libratelimiter.DefaultProviderRPS) +// reg := prometheus.NewRegistry() +// metrics := metrics.MustMakeMetrics(scheme, reg) +// return builder.Build()(mgr, log, rl, metrics) +// }, +// ). +// Start() +// Expect(err).ToNot(HaveOccurred()) +// defer func() { Expect(testEnv.Stop()).To(Succeed()) }() +// c := testEnv.Client +// +// claim := &v1alpha1.TestClaim{} +// claim.Name = "test-claim" +// claim.Namespace = "default" +// Expect(c.Create(ctx, claim)).To(Succeed()) +// +// By("Waiting for claimed") +// claimed := &v1alpha1.TestClaimed{} +// Eventually(func(g Gomega) { +// actualClaim := &v1alpha1.TestClaim{} +// g.Expect(c.Get(ctx, client.ObjectKeyFromObject(claim), actualClaim)).ToNot(HaveOccurred()) +// g.Expect(actualClaim.Spec.ClaimedRef).ToNot(BeNil()) +// g.Expect(c.Get(ctx, actualClaim.Spec.ClaimedRef.ObjectKey(), claimed)).ToNot(HaveOccurred()) +// g.Expect(claimed.Annotations[externalDataAnnotation]).To(Equal("version_1")) +// }).WithTimeout(1 * time.Second).Should(Succeed()) +// +// By("Making sure reconciliations finished") +// Eventually(func(g Gomega) { +// g.Expect(r.lastReconcileAt.Load().(time.Time)). +// To(BeTemporally("<=", time.Now().Add(-1*time.Second))) +// }).WithTimeout(3 * time.Second).Should(Succeed()) +// +// By("Updating external data and making sure reconciliation is not triggered") +// claimed = claimed.DeepCopy() // avoid race +// externalData = "version_2" +// Consistently(func(g Gomega) { +// g.Expect(c.Get(ctx, client.ObjectKeyFromObject(claimed), claimed)).ToNot(HaveOccurred()) +// g.Expect(claimed.Annotations[externalDataAnnotation]).To(Equal("version_1")) +// }).WithTimeout(1 * time.Second).Should(Succeed()) +// +// By("Triggering reconciliation via events channel") +// claimed = claimed.DeepCopy() // avoid race +// srcChan <- event.GenericEvent{Object: claimed} +// Eventually(func(g Gomega) { +// g.Expect(c.Get(ctx, client.ObjectKeyFromObject(claimed), claimed)).ToNot(HaveOccurred()) +// g.Expect(claimed.Annotations[externalDataAnnotation]).To(Equal("version_2")) +// }).WithTimeout(1 * time.Second).Should(Succeed()) +//}) +//}) diff --git a/pkg/internal/tests/api/test/v1alpha1/zz_generated.deepcopy.go b/pkg/internal/tests/api/test/v1alpha1/zz_generated.deepcopy.go index fc750b1..70f62f4 100644 --- a/pkg/internal/tests/api/test/v1alpha1/zz_generated.deepcopy.go +++ b/pkg/internal/tests/api/test/v1alpha1/zz_generated.deepcopy.go @@ -1,14 +1,12 @@ //go:build !ignore_autogenerated -// +build !ignore_autogenerated // Code generated by controller-gen. DO NOT EDIT. package v1alpha1 import ( - runtime "k8s.io/apimachinery/pkg/runtime" - "github.com/reddit/achilles-sdk-api/api" + runtime "k8s.io/apimachinery/pkg/runtime" ) // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. diff --git a/pkg/internal/tests/cluster/crd/bases/test.infrared.reddit.com_testclaimeds.yaml b/pkg/internal/tests/cluster/crd/bases/test.infrared.reddit.com_testclaimeds.yaml index ac7a947..5e0963d 100644 --- a/pkg/internal/tests/cluster/crd/bases/test.infrared.reddit.com_testclaimeds.yaml +++ b/pkg/internal/tests/cluster/crd/bases/test.infrared.reddit.com_testclaimeds.yaml @@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.10.0 - creationTimestamp: null + controller-gen.kubebuilder.io/version: v0.17.0 name: testclaimeds.test.infrared.reddit.com spec: group: test.infrared.reddit.com @@ -23,14 +22,19 @@ spec: openAPIV3Schema: properties: apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources type: string kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds type: string metadata: type: object @@ -75,20 +79,22 @@ spec: description: A Condition that may apply to a resource. properties: lastTransitionTime: - description: LastTransitionTime is the last time this condition - transitioned from one status to another. + description: |- + LastTransitionTime is the last time this condition transitioned from one + status to another. format: date-time type: string message: - description: A Message containing details about this condition's - last transition from one status to another, if any. + description: |- + A Message containing details about this condition's last transition from + one status to another, if any. type: string observedGeneration: - description: ObservedGeneration is the .metadata.generation - that the condition was set based on. For instance, if .metadata.generation - is currently 12, but the .status.conditions[x].observedGeneration - is 9, the condition is out of date with respect to the current - state of the instance. + description: |- + ObservedGeneration is the .metadata.generation that the condition was set based on. + For instance, if .metadata.generation is currently 12, but the + .status.conditions[x].observedGeneration is 9, the condition is out of date with respect + to the current state of the instance. format: int64 type: integer reason: @@ -100,8 +106,9 @@ spec: False, or Unknown? type: string type: - description: Type of this condition. At most one of each condition - type may apply to a resource at any point in time. + description: |- + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. type: string required: - lastTransitionTime diff --git a/pkg/internal/tests/cluster/crd/bases/test.infrared.reddit.com_testclaims.yaml b/pkg/internal/tests/cluster/crd/bases/test.infrared.reddit.com_testclaims.yaml index c77a7d5..4a592bf 100644 --- a/pkg/internal/tests/cluster/crd/bases/test.infrared.reddit.com_testclaims.yaml +++ b/pkg/internal/tests/cluster/crd/bases/test.infrared.reddit.com_testclaims.yaml @@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.10.0 - creationTimestamp: null + controller-gen.kubebuilder.io/version: v0.17.0 name: testclaims.test.infrared.reddit.com spec: group: test.infrared.reddit.com @@ -23,14 +22,19 @@ spec: openAPIV3Schema: properties: apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources type: string kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds type: string metadata: type: object @@ -78,20 +82,22 @@ spec: description: A Condition that may apply to a resource. properties: lastTransitionTime: - description: LastTransitionTime is the last time this condition - transitioned from one status to another. + description: |- + LastTransitionTime is the last time this condition transitioned from one + status to another. format: date-time type: string message: - description: A Message containing details about this condition's - last transition from one status to another, if any. + description: |- + A Message containing details about this condition's last transition from + one status to another, if any. type: string observedGeneration: - description: ObservedGeneration is the .metadata.generation - that the condition was set based on. For instance, if .metadata.generation - is currently 12, but the .status.conditions[x].observedGeneration - is 9, the condition is out of date with respect to the current - state of the instance. + description: |- + ObservedGeneration is the .metadata.generation that the condition was set based on. + For instance, if .metadata.generation is currently 12, but the + .status.conditions[x].observedGeneration is 9, the condition is out of date with respect + to the current state of the instance. format: int64 type: integer reason: @@ -103,8 +109,9 @@ spec: False, or Unknown? type: string type: - description: Type of this condition. At most one of each condition - type may apply to a resource at any point in time. + description: |- + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. type: string required: - lastTransitionTime @@ -146,9 +153,9 @@ spec: type: object type: array testField: - description: A field updated by the controller to match the Spec's - test field on reconciliation. Mutation to this field can be used - to verify if the reconcile loop has run in tests. + description: |- + A field updated by the controller to match the Spec's test field on reconciliation. + Mutation to this field can be used to verify if the reconcile loop has run in tests. type: string type: object type: object diff --git a/pkg/ratelimiter/ratelimit.go b/pkg/ratelimiter/ratelimit.go index abbbb5a..3bb8f54 100644 --- a/pkg/ratelimiter/ratelimit.go +++ b/pkg/ratelimiter/ratelimit.go @@ -5,7 +5,7 @@ import ( "golang.org/x/time/rate" "k8s.io/client-go/util/workqueue" - "sigs.k8s.io/controller-runtime/pkg/ratelimiter" + "sigs.k8s.io/controller-runtime/pkg/reconcile" ) const ( @@ -17,24 +17,36 @@ const ( // NewGlobal returns a token bucket rate limiter meant for limiting the number // of average total requeues per second for all controllers registered with a // controller manager. The bucket size (i.e. allowed burst) is rps * 10. -func NewGlobal(rps int) *workqueue.BucketRateLimiter { - return &workqueue.BucketRateLimiter{Limiter: rate.NewLimiter(rate.Limit(rps), rps*10)} +func NewGlobal(rps int) *workqueue.TypedBucketRateLimiter[reconcile.Request] { + return &workqueue.TypedBucketRateLimiter[reconcile.Request]{ + Limiter: rate.NewLimiter(rate.Limit(rps), rps*10), // burst = rps * 10 + } } // NewDefaultProviderRateLimiter returns a token bucket rate limiter meant for // limiting the number of average total requeues per second for all controllers // registered with a controller manager. The bucket size is a linear function of // the requeues per second. -func NewDefaultProviderRateLimiter(rps int) *workqueue.BucketRateLimiter { +func NewDefaultProviderRateLimiter(rps int) *workqueue.TypedBucketRateLimiter[reconcile.Request] { return NewGlobal(rps) } // NewDefaultManagedRateLimiter returns a rate limiter that takes the maximum // delay between the passed provider and a per-item exponential backoff limiter. // The exponential backoff limiter has a base delay of 1s and a maximum of 60s. -func NewDefaultManagedRateLimiter(provider ratelimiter.RateLimiter) ratelimiter.RateLimiter { - return workqueue.NewMaxOfRateLimiter( - workqueue.NewItemExponentialFailureRateLimiter(1*time.Second, 60*time.Second), +func NewDefaultManagedRateLimiter(provider workqueue.TypedRateLimiter[reconcile.Request]) workqueue.TypedRateLimiter[reconcile.Request] { + return workqueue.NewTypedMaxOfRateLimiter[reconcile.Request]( + workqueue.NewTypedItemExponentialFailureRateLimiter[reconcile.Request](1*time.Second, 60*time.Second), + provider, + ) +} + +// NewZeroDelayManagedRateLimiter returns a rate limiter that takes the +// maximum delay between the passed provider and a per-item exponential backoff +// limiter. The exponential backoff limiter has a base delay of 0s and a maximum of 60s. +func NewZeroDelayManagedRateLimiter(provider workqueue.TypedRateLimiter[reconcile.Request]) workqueue.TypedRateLimiter[reconcile.Request] { + return workqueue.NewTypedMaxOfRateLimiter[reconcile.Request]( + workqueue.NewTypedItemExponentialFailureRateLimiter[reconcile.Request](0*time.Second, 60*time.Second), provider, ) } diff --git a/tools/go.mod b/tools/go.mod index fe910bd..72f9c09 100644 --- a/tools/go.mod +++ b/tools/go.mod @@ -1,81 +1,80 @@ module tools -go 1.22 +go 1.23.0 + +toolchain go1.23.4 require ( github.com/clamoriniere/crd-to-markdown v0.0.3 - github.com/rinchsan/gosimports v0.3.5 - honnef.co/go/tools v0.4.6 - sigs.k8s.io/controller-runtime/tools/setup-envtest v0.0.0-20220119181005-7ba3e559790c - sigs.k8s.io/controller-tools v0.10.0 + github.com/rinchsan/gosimports v0.3.8 + honnef.co/go/tools v0.5.1 + sigs.k8s.io/controller-runtime/tools/setup-envtest v0.0.0-20250110065032-d19d76c3a88f + sigs.k8s.io/controller-tools v0.17.0 sigs.k8s.io/kustomize/kustomize/v4 v4.5.7 ) require ( - github.com/BurntSushi/toml v1.2.1 // indirect - github.com/PuerkitoBio/purell v1.1.1 // indirect - github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect + github.com/BurntSushi/toml v1.4.1-0.20240526193622-a339e1f7089c // indirect github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a // indirect - github.com/davecgh/go-spew v1.1.1 // indirect + github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/evanphx/json-patch v4.12.0+incompatible // indirect - github.com/fatih/color v1.12.0 // indirect + github.com/fatih/color v1.18.0 // indirect + github.com/fxamacker/cbor/v2 v2.7.0 // indirect github.com/go-errors/errors v1.0.1 // indirect - github.com/go-logr/logr v1.2.3 // indirect - github.com/go-logr/zapr v1.2.0 // indirect - github.com/go-openapi/jsonpointer v0.19.5 // indirect - github.com/go-openapi/jsonreference v0.19.5 // indirect - github.com/go-openapi/swag v0.19.14 // indirect - github.com/gobuffalo/flect v0.2.5 // indirect + github.com/go-logr/logr v1.4.2 // indirect + github.com/go-logr/zapr v1.3.0 // indirect + github.com/go-openapi/jsonpointer v0.21.0 // indirect + github.com/go-openapi/jsonreference v0.20.2 // indirect + github.com/go-openapi/swag v0.23.0 // indirect + github.com/gobuffalo/flect v1.0.3 // indirect github.com/gogo/protobuf v1.3.2 // indirect - github.com/golang/protobuf v1.5.2 // indirect + github.com/golang/protobuf v1.5.4 // indirect github.com/google/gnostic v0.5.7-v3refs // indirect - github.com/google/go-cmp v0.5.8 // indirect - github.com/google/gofuzz v1.1.0 // indirect + github.com/google/gnostic-models v0.6.8 // indirect + github.com/google/gofuzz v1.2.0 // indirect github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect - github.com/google/uuid v1.2.0 // indirect github.com/imdario/mergo v0.3.11 // indirect - github.com/inconshreveable/mousetrap v1.0.0 // indirect + github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect - github.com/mailru/easyjson v0.7.6 // indirect - github.com/mattn/go-colorable v0.1.8 // indirect - github.com/mattn/go-isatty v0.0.12 // indirect + github.com/mailru/easyjson v0.7.7 // 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.7 // indirect - github.com/mitchellh/mapstructure v1.4.1 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 // indirect github.com/olekukonko/tablewriter v0.0.4 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/spf13/afero v1.6.0 // indirect - github.com/spf13/cobra v1.4.0 // indirect + github.com/spf13/cobra v1.8.1 // indirect github.com/spf13/pflag v1.0.5 // indirect + github.com/x448/float16 v0.8.4 // indirect github.com/xlab/treeprint v1.1.0 // indirect go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5 // indirect - go.uber.org/atomic v1.7.0 // indirect - go.uber.org/multierr v1.6.0 // indirect - go.uber.org/zap v1.19.1 // indirect - golang.org/x/exp/typeparams v0.0.0-20221208152030-732eee02a75a // indirect - golang.org/x/mod v0.12.0 // indirect - golang.org/x/net v0.14.0 // indirect - golang.org/x/sys v0.11.0 // indirect - golang.org/x/text v0.12.0 // indirect - golang.org/x/tools v0.12.1-0.20230825192346-2191a27a6dc5 // indirect - google.golang.org/protobuf v1.28.0 // indirect - gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b // indirect + go.uber.org/multierr v1.11.0 // indirect + go.uber.org/zap v1.27.0 // indirect + golang.org/x/exp/typeparams v0.0.0-20231108232855-2478ac86f678 // indirect + golang.org/x/mod v0.22.0 // indirect + golang.org/x/net v0.33.0 // indirect + golang.org/x/sync v0.10.0 // indirect + golang.org/x/sys v0.28.0 // indirect + golang.org/x/text v0.21.0 // indirect + golang.org/x/tools v0.28.0 // indirect + google.golang.org/protobuf v1.35.1 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - k8s.io/api v0.25.0 // indirect - k8s.io/apiextensions-apiserver v0.25.0 // indirect - k8s.io/apimachinery v0.25.0 // indirect - k8s.io/klog/v2 v2.70.1 // indirect - k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1 // indirect - k8s.io/utils v0.0.0-20220728103510-ee6ede2d64ed // indirect - sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect + k8s.io/api v0.32.0 // indirect + k8s.io/apiextensions-apiserver v0.32.0 // indirect + k8s.io/apimachinery v0.32.0 // indirect + k8s.io/klog/v2 v2.130.1 // indirect + k8s.io/kube-openapi v0.0.0-20241105132330-32ad38e42d3f // indirect + k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738 // indirect + sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3 // indirect sigs.k8s.io/kustomize/api v0.12.1 // indirect sigs.k8s.io/kustomize/cmd/config v0.10.9 // indirect sigs.k8s.io/kustomize/kyaml v0.13.9 // indirect - sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect - sigs.k8s.io/yaml v1.3.0 // indirect + sigs.k8s.io/structured-merge-diff/v4 v4.4.2 // indirect + sigs.k8s.io/yaml v1.4.0 // indirect ) diff --git a/tools/go.sum b/tools/go.sum index b409db9..9e463e3 100644 --- a/tools/go.sum +++ b/tools/go.sum @@ -1,15 +1,9 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/BurntSushi/toml v1.2.1 h1:9F2/+DoOYIOksmaJFPw1tGFy1eDnIJXg+UHjuD8lTak= -github.com/BurntSushi/toml v1.2.1/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= -github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI= -github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= -github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M= -github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= +github.com/BurntSushi/toml v1.4.1-0.20240526193622-a339e1f7089c h1:pxW6RcqyfI9/kWtOwnv/G+AzdKuy2ZrqINhenH4HyNs= +github.com/BurntSushi/toml v1.4.1-0.20240526193622-a339e1f7089c/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a h1:idn718Q4B6AGu/h5Sxe66HYVdqdGu2l9Iebqhi/AEoA= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= -github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= -github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= @@ -17,38 +11,41 @@ github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMn github.com/clamoriniere/crd-to-markdown v0.0.3 h1:vc/OUe8nKj8IWHUrPS9Un4VE/0eoi0AHAIpRASj45xM= github.com/clamoriniere/crd-to-markdown v0.0.3/go.mod h1:omY8/yoJUnFTECLMuCW4Od3ry+imsGPgxm5mwQmqtQg= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cpuguy83/go-md2man/v2 v2.0.1/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= 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= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/evanphx/json-patch v4.12.0+incompatible h1:4onqiflcdA9EOZ4RxV643DvftH5pOlLGNtQ5lPWQu84= github.com/evanphx/json-patch v4.12.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/fatih/color v1.12.0 h1:mRhaKNwANqRgUBGKmnI5ZxEk7QXmjQeCcuYFMX2bfcc= -github.com/fatih/color v1.12.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM= -github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= -github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= +github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM= +github.com/fatih/color v1.18.0/go.mod h1:4FelSpRwEGDpQ12mAdzqdOukCy4u8WUtOY6lkT/6HfU= +github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= +github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= +github.com/fxamacker/cbor/v2 v2.7.0 h1:iM5WgngdRBanHcxugY4JySA0nk1wZorNOpTgCMedv5E= +github.com/fxamacker/cbor/v2 v2.7.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ= github.com/go-errors/errors v1.0.1 h1:LUHzmkK3GUKUrL/1gfBUxAHzcev3apQlezX/+O7ma6w= github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= -github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= -github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0= -github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/zapr v1.2.0 h1:n4JnPI1T3Qq1SFEi/F8rwLrZERp2bso19PJZDB9dayk= -github.com/go-logr/zapr v1.2.0/go.mod h1:Qa4Bsj2Vb+FAVeAKsLD8RLQ+YRJB8YDmOAKxaBQf7Ro= -github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonpointer v0.19.5 h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY= -github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonreference v0.19.5 h1:1WJP/wi4OjB4iV8KVbH73rQaoialJrqv8gitZLxGLtM= -github.com/go-openapi/jsonreference v0.19.5/go.mod h1:RdybgQwPxbL4UEjuAruzK1x3nE69AqPYEJeo/TWfEeg= -github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= -github.com/go-openapi/swag v0.19.14 h1:gm3vOOXfiuw5i9p5N9xJvfjvuofpyvLA9Wr6QfK5Fng= -github.com/go-openapi/swag v0.19.14/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= -github.com/gobuffalo/flect v0.2.5 h1:H6vvsv2an0lalEaCDRThvtBfmg44W/QHXBCYUXf/6S4= -github.com/gobuffalo/flect v0.2.5/go.mod h1:1ZyCLIbg0YD7sDkzvFdPoOydPtD8y9JQnrOROolUcM8= +github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= +github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/zapr v1.3.0 h1:XGdV8XW8zdwFiwOA2Dryh1gj2KRQyOOoNmBy4EplIcQ= +github.com/go-logr/zapr v1.3.0/go.mod h1:YKepepNBd1u/oyhd/yQmtjVXmm9uML4IXUgMOwR8/Gg= +github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs= +github.com/go-openapi/jsonpointer v0.21.0 h1:YgdVicSA9vH5RiHs9TZW5oyafXZFc6+2Vc1rr/O9oNQ= +github.com/go-openapi/jsonpointer v0.21.0/go.mod h1:IUyH9l/+uyhIYQ/PXVA41Rexl+kOkAPDdXEYns6fzUY= +github.com/go-openapi/jsonreference v0.20.2 h1:3sVjiK66+uXK/6oQ8xgcRKcFgQ5KXa2KvnJRumpMGbE= +github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k= +github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= +github.com/go-openapi/swag v0.23.0 h1:vsEVJDUo2hPJ2tu0/Xc+4noaxyEffXNIs3cOULZ+GrE= +github.com/go-openapi/swag v0.23.0/go.mod h1:esZ8ITTYEsH1V2trKHjAN8Ai7xHb8RV+YSZ577vPjgQ= +github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= +github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= +github.com/gobuffalo/flect v1.0.3 h1:xeWBM2nui+qnVvNM4S3foBhCAL2XgPU+a7FdpelbTq4= +github.com/gobuffalo/flect v1.0.3/go.mod h1:A5msMlrHtLqh9umBSnvabjsMrCcCpAyzglnDvkbYKHs= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= @@ -62,28 +59,34 @@ github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:W github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/google/gnostic v0.5.7-v3refs h1:FhTMOKj2VhjpouxvWJAV1TL304uMlb9zcDqkl6cEI54= github.com/google/gnostic v0.5.7-v3refs/go.mod h1:73MKFl6jIHelAJNaBGFzt3SPtZULs9dYrGFt8OiIsHQ= +github.com/google/gnostic-models v0.6.8 h1:yo/ABAfM5IMRsS1VnXjTBvUb61tFIHozhlYvRgGre9I= +github.com/google/gnostic-models v0.6.8/go.mod h1:5n7qKqH0f5wFt+aWF8CW6pZLLNOfYuF5OpfBSENuI8U= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= -github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +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/gofuzz v1.1.0 h1:Hsa8mG0dQ46ij8Sl2AYJDUv1oA9/d6Vk+3LG99Oe02g= -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/pprof v0.0.0-20241029153458-d1b30febd7db h1:097atOisP2aRj7vFgYQBbFN4U4JNXUNYpxael3UzMyo= +github.com/google/pprof v0.0.0-20241029153458-d1b30febd7db/go.mod h1:vavhavw2zAxS5dIdcRluK6cSGGPlZynqzFM8NdvU144= github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4= github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= -github.com/google/uuid v1.2.0 h1:qJYtXnJRWmpe7m/3XlyhrsLrEURqHRM2kxzoxXqyUDs= -github.com/google/uuid v1.2.0/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= github.com/imdario/mergo v0.3.11 h1:3tnifQM4i+fbajXKBHXWEH+KvNHqojZ778UH75j3bGA= github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= -github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= -github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= +github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= @@ -91,24 +94,23 @@ github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHm 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/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= -github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.7.6 h1:8yTIVnZgCoiM1TgqoeTl+LfU5Jg6/xL3QhGQnimLYnA= -github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= -github.com/mattn/go-colorable v0.1.8 h1:c1ghPdyEDarC70ftn0y+A/Ee++9zz8ljHG1b13eJ0s8= -github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= -github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= +github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= +github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= +github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= +github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= +github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= +github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-runewidth v0.0.7 h1:Ei8KR0497xHyKJPAv59M1dkC+rOZCMBJ+t3fZ+twI54= github.com/mattn/go-runewidth v0.0.7/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= -github.com/mitchellh/mapstructure v1.4.1 h1:CpVNEelQCZBooIPDn+AR3NpivK/TIKU8bDxdASFVQag= -github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= 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= @@ -116,128 +118,120 @@ github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9G github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 h1:n6/2gBQ3RWajuToeY6ZtZTIKv2v7ThUy5KKusIT0yc0= github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00/go.mod h1:Pm3mSP3c5uWn86xMLZ5Sa7JB9GsEZySvHYXCTK4E9q4= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/olekukonko/tablewriter v0.0.4 h1:vHD/YYe1Wolo78koG299f7V/VAS08c6IpCLn+Ejf/w8= github.com/olekukonko/tablewriter v0.0.4/go.mod h1:zq6QwlOf5SlnkVbMSr5EoBv3636FWnp+qbPhuoO21uA= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= -github.com/onsi/gomega v1.19.0 h1:4ieX6qQjPP/BfC3mpsAtIGGlxTWPeA3Inl/7DtXw1tw= -github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= +github.com/onsi/ginkgo/v2 v2.21.0 h1:7rg/4f3rB88pb5obDgNZrNHrQ4e6WpjonchcpuBRnZM= +github.com/onsi/ginkgo/v2 v2.21.0/go.mod h1:7Du3c42kxCUegi0IImZ1wUQzMBVecgIHjR1C+NkhLQo= +github.com/onsi/gomega v1.36.2 h1:koNYke6TVk6ZmnyHrCXba/T/MoLBXFjeC1PtvYgw0A8= +github.com/onsi/gomega v1.36.2/go.mod h1:DdwyADRjrc825LhMEkD76cHR5+pUnjhUN8GlHlRPHzY= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/rinchsan/gosimports v0.3.5 h1:Zm7rv4pmDKKiuRApnBRRbgezBkZcXuKa51bchPW0T/s= -github.com/rinchsan/gosimports v0.3.5/go.mod h1:Nn5Faais3xcme3mYJGFw7kppu/KpteHEaf1A/aKhkO4= +github.com/rinchsan/gosimports v0.3.8 h1:X4Pb9yFf6teHvogorT04yK/0W2Df7eHO79biCcYrA4c= +github.com/rinchsan/gosimports v0.3.8/go.mod h1:t0567k69sUHjLvJMPDsV31THZC+8UIbY1oL7NW+0I2c= +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/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0= github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= -github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= github.com/spf13/afero v1.6.0 h1:xoax2sJ2DT8S8xA2paPFjDCScCNeWsg75VG0DLRreiY= github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= -github.com/spf13/cobra v1.4.0 h1:y+wJpx64xcgO1V+RcnwW0LEHxTKRi2ZDPSBjWnrg88Q= -github.com/spf13/cobra v1.4.0/go.mod h1:Wo4iy3BUC+X2Fybo0PDqwJIv3dNRiZLHQymsfxlB84g= +github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM= +github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.2.0 h1:Hbg2NidpLE8veEBkEZTL3CvlkUIVzuU9jDplZO54c48= -github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= 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.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= +github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= github.com/xlab/treeprint v1.1.0 h1:G/1DjNkPpfZCFt9CSh6b5/nY4VimlbHF3Rh4obvtzDk= github.com/xlab/treeprint v1.1.0/go.mod h1:gj5Gd3gPdKtR1ikdDK6fnFLdmIS0X30kTTuNd/WEJu0= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5 h1:+FNtrFTmVw0YZGpBGX56XDee331t6JAXeK2bcyhLOOc= go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5/go.mod h1:nmDLcffg48OtT/PSW0Hg7FvpRQsQh5OSqIylirxKC7o= -go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw= -go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= -go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= -go.uber.org/goleak v1.1.11-0.20210813005559-691160354723 h1:sHOAIxRGBp443oHZIPB+HsUGaksVCXVQENPxwTfQdH4= -go.uber.org/goleak v1.1.11-0.20210813005559-691160354723/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= -go.uber.org/multierr v1.6.0 h1:y6IPFStTAIT5Ytl7/XYmHvzXQ7S3g/IeZW9hyZ5thw4= -go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= -go.uber.org/zap v1.19.0/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= -go.uber.org/zap v1.19.1 h1:ue41HOKd1vGURxrmeKIgELGb3jPW9DMUDGtsinblHwI= -go.uber.org/zap v1.19.1/go.mod h1:j3DNczoxDZroyBnOT1L/Q79cfUMGZxlv/9dzN7SM1rI= +go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= +go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= +go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= +go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= +go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= +go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp/typeparams v0.0.0-20221208152030-732eee02a75a h1:Jw5wfR+h9mnIYH+OtGT2im5wV1YGGDora5vTv/aa5bE= -golang.org/x/exp/typeparams v0.0.0-20221208152030-732eee02a75a/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= +golang.org/x/exp/typeparams v0.0.0-20231108232855-2478ac86f678 h1:1P7xPZEwZMoBoz0Yze5Nx2/4pxj6nw9ZqHWXqP0iRgQ= +golang.org/x/exp/typeparams v0.0.0-20231108232855-2478ac86f678/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc= -golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.22.0 h1:D4nJWe9zXqHOmWqj4VMOJhvzj7bEZg4wEYa759z1pH4= +golang.org/x/mod v0.22.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= 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-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/net v0.14.0 h1:BONx9s002vGdD9umnlX1Po8vOZmrgH34qlHcD1MfK14= -golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI= +golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= +golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= 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-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E= -golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= +golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ= +golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191002063906-3421d5a6bb1c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= -golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= +golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.12.0 h1:k+n5B8goJNdU7hSvEtMUz3d1Q6D/XW4COJSJR6fN0mc= -golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.12.1-0.20230825192346-2191a27a6dc5 h1:Vk4mysSz+GqQK2eqgWbo4zEO89wkeAjJiFIr9bpqa8k= -golang.org/x/tools v0.12.1-0.20230825192346-2191a27a6dc5/go.mod h1:Sc0INKfu04TlqNoRA1hgpFZbhYXHPr4V5DzpSBTPqQM= +golang.org/x/tools v0.28.0 h1:WuB6qZ4RPCQo5aP3WdKZS7i595EdWqWR8vqJTlwTVK8= +golang.org/x/tools v0.28.0/go.mod h1:dcIOrVd3mfQKTgrDVQHqCPMWy6lnhfhtX3hLXYVLfRw= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -261,51 +255,46 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= 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.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= -google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +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= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b h1:QRR6H1YWRnHb4Y/HeNFCTJLFVxaq6wH4YuVdsUOr75U= -gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b/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/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.4.6 h1:oFEHCKeID7to/3autwsWfnuv69j3NsfcXbvJKuIcep8= -honnef.co/go/tools v0.4.6/go.mod h1:+rnGS1THNh8zMwnd2oVOTL9QF6vmfyG6ZXBULae2uc0= -k8s.io/api v0.25.0 h1:H+Q4ma2U/ww0iGB78ijZx6DRByPz6/733jIuFpX70e0= -k8s.io/api v0.25.0/go.mod h1:ttceV1GyV1i1rnmvzT3BST08N6nGt+dudGrquzVQWPk= -k8s.io/apiextensions-apiserver v0.25.0 h1:CJ9zlyXAbq0FIW8CD7HHyozCMBpDSiH7EdrSTCZcZFY= -k8s.io/apiextensions-apiserver v0.25.0/go.mod h1:3pAjZiN4zw7R8aZC5gR0y3/vCkGlAjCazcg1me8iB/E= -k8s.io/apimachinery v0.25.0 h1:MlP0r6+3XbkUG2itd6vp3oxbtdQLQI94fD5gCS+gnoU= -k8s.io/apimachinery v0.25.0/go.mod h1:qMx9eAk0sZQGsXGu86fab8tZdffHbwUfsvzqKn4mfB0= -k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= -k8s.io/klog/v2 v2.70.1 h1:7aaoSdahviPmR+XkS7FyxlkkXs6tHISSG03RxleQAVQ= -k8s.io/klog/v2 v2.70.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= -k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1 h1:MQ8BAZPZlWk3S9K4a9NCkIFQtZShWqoha7snGixVgEA= -k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1/go.mod h1:C/N6wCaBHeBHkHUesQOQy2/MZqGgMAFPqGsGQLdbZBU= -k8s.io/utils v0.0.0-20220728103510-ee6ede2d64ed h1:jAne/RjBTyawwAy0utX5eqigAwz/lQhTmy+Hr/Cpue4= -k8s.io/utils v0.0.0-20220728103510-ee6ede2d64ed/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -sigs.k8s.io/controller-runtime/tools/setup-envtest v0.0.0-20220119181005-7ba3e559790c h1:wR7SQFzUvVkkZ19RuhkhGh6guVicSKy09847QveLnGw= -sigs.k8s.io/controller-runtime/tools/setup-envtest v0.0.0-20220119181005-7ba3e559790c/go.mod h1:nLkMD2WB4Jcix1qfVuJeOF4j5y/VfyeOIlTxG5Wj9co= -sigs.k8s.io/controller-tools v0.10.0 h1:0L5DTDTFB67jm9DkfrONgTGmfc/zYow0ZaHyppizU2U= -sigs.k8s.io/controller-tools v0.10.0/go.mod h1:uvr0EW6IsprfB0jpQq6evtKy+hHyHCXNfdWI5ONPx94= -sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 h1:iXTIw73aPyC+oRdyqqvVJuloN1p0AC/kzH07hu3NE+k= -sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= +honnef.co/go/tools v0.5.1 h1:4bH5o3b5ZULQ4UrBmP+63W9r7qIkqJClEA9ko5YKx+I= +honnef.co/go/tools v0.5.1/go.mod h1:e9irvo83WDG9/irijV44wr3tbhcFeRnfpVlRqVwpzMs= +k8s.io/api v0.32.0 h1:OL9JpbvAU5ny9ga2fb24X8H6xQlVp+aJMFlgtQjR9CE= +k8s.io/api v0.32.0/go.mod h1:4LEwHZEf6Q/cG96F3dqR965sYOfmPM7rq81BLgsE0p0= +k8s.io/apiextensions-apiserver v0.32.0 h1:S0Xlqt51qzzqjKPxfgX1xh4HBZE+p8KKBq+k2SWNOE0= +k8s.io/apiextensions-apiserver v0.32.0/go.mod h1:86hblMvN5yxMvZrZFX2OhIHAuFIMJIZ19bTvzkP+Fmw= +k8s.io/apimachinery v0.32.0 h1:cFSE7N3rmEEtv4ei5X6DaJPHHX0C+upp+v5lVPiEwpg= +k8s.io/apimachinery v0.32.0/go.mod h1:GpHVgxoKlTxClKcteaeuF1Ul/lDVb74KpZcxcmLDElE= +k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= +k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= +k8s.io/kube-openapi v0.0.0-20241105132330-32ad38e42d3f h1:GA7//TjRY9yWGy1poLzYYJJ4JRdzg3+O6e8I+e+8T5Y= +k8s.io/kube-openapi v0.0.0-20241105132330-32ad38e42d3f/go.mod h1:R/HEjbvWI0qdfb8viZUeVZm0X6IZnxAydC7YU42CMw4= +k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738 h1:M3sRQVHv7vB20Xc2ybTt7ODCeFj6JSWYFzOFnYeS6Ro= +k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= +sigs.k8s.io/controller-runtime/tools/setup-envtest v0.0.0-20250110065032-d19d76c3a88f h1:ATN/ju6NmwGunQ37bp/2OqrP6sHcI/qICqBP5wiaTvo= +sigs.k8s.io/controller-runtime/tools/setup-envtest v0.0.0-20250110065032-d19d76c3a88f/go.mod h1:Is2SwCWbWAoyGVoVBA627n1SWhWaEwUhaIYSEbtzHT4= +sigs.k8s.io/controller-tools v0.17.0 h1:KaEQZbhrdY6J3zLBHplt+0aKUp8PeIttlhtF2UDo6bI= +sigs.k8s.io/controller-tools v0.17.0/go.mod h1:SKoWY8rwGWDzHtfnhmOwljn6fViG0JF7/xmnxpklgjo= +sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3 h1:/Rv+M11QRah1itp8VhT6HoVx1Ray9eB4DBr+K+/sCJ8= +sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3/go.mod h1:18nIHnGi6636UCz6m8i4DhaJ65T6EruyzmoQqI2BVDo= sigs.k8s.io/kustomize/api v0.12.1 h1:7YM7gW3kYBwtKvoY216ZzY+8hM+lV53LUayghNRJ0vM= sigs.k8s.io/kustomize/api v0.12.1/go.mod h1:y3JUhimkZkR6sbLNwfJHxvo1TCLwuwm14sCYnkH6S1s= sigs.k8s.io/kustomize/cmd/config v0.10.9 h1:LV8AUwZPuvqhGfia50uNwsPwNg1xOy9koEf5hyBnYs4= @@ -314,7 +303,7 @@ sigs.k8s.io/kustomize/kustomize/v4 v4.5.7 h1:cDW6AVMl6t/SLuQaezMET8hgnadZGIAr8tU sigs.k8s.io/kustomize/kustomize/v4 v4.5.7/go.mod h1:VSNKEH9D9d9bLiWEGbS6Xbg/Ih0tgQalmPvntzRxZ/Q= sigs.k8s.io/kustomize/kyaml v0.13.9 h1:Qz53EAaFFANyNgyOEJbT/yoIHygK40/ZcvU3rgry2Tk= sigs.k8s.io/kustomize/kyaml v0.13.9/go.mod h1:QsRbD0/KcU+wdk0/L0fIp2KLnohkVzs6fQ85/nOXac4= -sigs.k8s.io/structured-merge-diff/v4 v4.2.3 h1:PRbqxJClWWYMNV1dhaG4NsibJbArud9kFxnAMREiWFE= -sigs.k8s.io/structured-merge-diff/v4 v4.2.3/go.mod h1:qjx8mGObPmV2aSZepjQjbmb2ihdVs8cGKBraizNC69E= -sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= -sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= +sigs.k8s.io/structured-merge-diff/v4 v4.4.2 h1:MdmvkGuXi/8io6ixD5wud3vOLwc1rj0aNqRlpuvjmwA= +sigs.k8s.io/structured-merge-diff/v4 v4.4.2/go.mod h1:N8f93tFZh9U6vpxwRArLiikrE5/2tiu1w1AGfACIGE4= +sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= +sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= From 0f9a681e91b0cc338be3f072393a23ab2cbe80e0 Mon Sep 17 00:00:00 2001 From: shadialtarsha Date: Tue, 14 Jan 2025 12:43:19 +0100 Subject: [PATCH 02/17] add two more watches --- go.mod | 2 - pkg/fsm/builder.go | 72 +++- pkg/fsm/claim_builder.go | 58 +++- pkg/fsm/test/chan/chan_test.go | 312 +++++++++--------- .../test/v1alpha1/zz_generated.deepcopy.go | 3 +- 5 files changed, 273 insertions(+), 174 deletions(-) diff --git a/go.mod b/go.mod index 459ed42..7bd739f 100644 --- a/go.mod +++ b/go.mod @@ -2,8 +2,6 @@ module github.com/reddit/achilles-sdk go 1.23.0 -toolchain go1.23.4 - require ( github.com/fgrosse/zaptest v1.2.1 github.com/go-logr/zapr v1.3.0 diff --git a/pkg/fsm/builder.go b/pkg/fsm/builder.go index e8f4ada..c025675 100644 --- a/pkg/fsm/builder.go +++ b/pkg/fsm/builder.go @@ -10,8 +10,10 @@ import ( "k8s.io/client-go/util/workqueue" ctrl "sigs.k8s.io/controller-runtime" ctrlbuilder "sigs.k8s.io/controller-runtime/pkg/builder" + "sigs.k8s.io/controller-runtime/pkg/cache" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/controller" + "sigs.k8s.io/controller-runtime/pkg/event" "sigs.k8s.io/controller-runtime/pkg/handler" "sigs.k8s.io/controller-runtime/pkg/predicate" "sigs.k8s.io/controller-runtime/pkg/reconcile" @@ -57,7 +59,8 @@ type Builder[T any, Obj apitypes.FSMResource[T]] struct { managedTypes []schema.GroupVersionKind controllerFns []ControllerFunc watches []watch - watchesRawSource []watchRawSource + watchKinds []watchKind + watchChannels []watchChannel opts []buildOption maxConcurrentReconciles int reconcilerOptions fsmtypes.ReconcilerOptions[T, Obj] @@ -70,11 +73,19 @@ type watch struct { triggerType fsmhandler.TriggerType } -type watchRawSource struct { - src source.Source +type watchKind struct { + cache cache.Cache + obj client.Object + handler handler.EventHandler + predicates []predicate.Predicate + triggerType fsmhandler.TriggerType +} + +type watchChannel struct { + source <-chan event.GenericEvent handler handler.EventHandler - opts []ctrlbuilder.WatchesOption triggerType fsmhandler.TriggerType + opts []source.ChannelOpt[client.Object, reconcile.Request] } // NewBuilder returns a builder that builds a function wiring up a logical FSM controller to a manager. @@ -148,16 +159,34 @@ func (b *Builder[T, Obj]) Watches( return b } -// WatchesRawSource adds a custom raw source watch to the controller. -// Prefer using `Watches(...)` unless you need controller-runtime's lower level API. -func (b *Builder[T, Obj]) WatchesRawSource( - src source.Source, +// WatchesKind adds a new watch to the controller for a specific kind. +// Use this method for events originating in the cluster. +func (b *Builder[T, Obj]) WatchesKind( + cache cache.Cache, + obj client.Object, handler handler.EventHandler, triggerType fsmhandler.TriggerType, - opts ...ctrlbuilder.WatchesOption, + predicates ...predicate.Predicate, +) *Builder[T, Obj] { + b.watchKinds = append(b.watchKinds, watchKind{ + cache: cache, + obj: obj, + handler: handler, + triggerType: triggerType, + predicates: predicates, + }) + return b +} + +// WatchesChannel adds a new watch to the controller for events originating outside the cluster. +func (b *Builder[T, Obj]) WatchesChannel( + source <-chan event.GenericEvent, + handler handler.EventHandler, + triggerType fsmhandler.TriggerType, + opts ...source.ChannelOpt[client.Object, reconcile.Request], ) *Builder[T, Obj] { - b.watchesRawSource = append(b.watchesRawSource, watchRawSource{ - src: src, + b.watchChannels = append(b.watchChannels, watchChannel{ + source: source, handler: handler, triggerType: triggerType, opts: opts, @@ -232,8 +261,25 @@ func (b *Builder[T, Obj]) Build() SetupFunc { ) } - for _, w := range b.watchesRawSource { - builder.WatchesRawSource(w.src) + for _, w := range b.watchKinds { + src := source.Kind( + w.cache, + w.obj, + fsmhandler.NewObservedEventHandler(log, scheme, name, metrics, w.handler, w.triggerType), + w.predicates..., + ) + + builder.WatchesRawSource(src) + } + + for _, w := range b.watchChannels { + src := source.Channel( + w.source, + fsmhandler.NewObservedEventHandler(log, scheme, name, metrics, w.handler, w.triggerType), + w.opts..., + ) + + builder.WatchesRawSource(src) } // custom controller builder options diff --git a/pkg/fsm/claim_builder.go b/pkg/fsm/claim_builder.go index 4d47881..c392874 100644 --- a/pkg/fsm/claim_builder.go +++ b/pkg/fsm/claim_builder.go @@ -11,8 +11,10 @@ import ( "k8s.io/client-go/util/workqueue" ctrl "sigs.k8s.io/controller-runtime" ctrlbuilder "sigs.k8s.io/controller-runtime/pkg/builder" + "sigs.k8s.io/controller-runtime/pkg/cache" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/controller" + "sigs.k8s.io/controller-runtime/pkg/event" "sigs.k8s.io/controller-runtime/pkg/handler" "sigs.k8s.io/controller-runtime/pkg/predicate" "sigs.k8s.io/controller-runtime/pkg/reconcile" @@ -39,7 +41,8 @@ type ClaimBuilder[T any, U any, ClaimedType apitypes.ClaimedType[T], ClaimType a managedTypes []schema.GroupVersionKind controllerFns []ControllerFunc watches []watch - watchesRawSource []watchRawSource + watchKinds []watchKind + watchChannels []watchChannel opts []buildOption maxConcurrentReconciles int } @@ -120,16 +123,34 @@ func (b *ClaimBuilder[T, U, ClaimedType, ClaimType]) Watches( return b } -// WatchesRawSource adds a custom raw source watch to the controller. -// Prefer using `Watches(...)` unless you need controller-runtime's lower level API. -func (b *ClaimBuilder[T, U, ClaimedType, ClaimType]) WatchesRawSource( - src source.Source, +// WatchesKind adds a new watch to the controller for a specific kind. +// Use this method for events originating in the cluster. +func (b *ClaimBuilder[T, U, ClaimedType, ClaimType]) WatchesKind( + cache cache.Cache, + obj client.Object, handler handler.EventHandler, triggerType fsmhandler.TriggerType, - opts ...ctrlbuilder.WatchesOption, + predicates ...predicate.Predicate, +) *ClaimBuilder[T, U, ClaimedType, ClaimType] { + b.watchKinds = append(b.watchKinds, watchKind{ + cache: cache, + obj: obj, + handler: handler, + triggerType: triggerType, + predicates: predicates, + }) + return b +} + +// WatchesChannel adds a new watch to the controller for events originating outside the cluster. +func (b *ClaimBuilder[T, U, ClaimedType, ClaimType]) WatchesChannel( + source <-chan event.GenericEvent, + handler handler.EventHandler, + triggerType fsmhandler.TriggerType, + opts ...source.ChannelOpt[client.Object, reconcile.Request], ) *ClaimBuilder[T, U, ClaimedType, ClaimType] { - b.watchesRawSource = append(b.watchesRawSource, watchRawSource{ - src: src, + b.watchChannels = append(b.watchChannels, watchChannel{ + source: source, handler: handler, triggerType: triggerType, opts: opts, @@ -261,8 +282,25 @@ func (b *ClaimBuilder[T, U, ClaimedType, ClaimType]) Build() SetupFunc { ) } - for _, w := range b.watchesRawSource { - claimedBuilder.WatchesRawSource(w.src) + for _, w := range b.watchKinds { + src := source.Kind( + w.cache, + w.obj, + fsmhandler.NewObservedEventHandler(log, scheme, name, metrics, w.handler, w.triggerType), + w.predicates..., + ) + + claimedBuilder.WatchesRawSource(src) + } + + for _, w := range b.watchChannels { + src := source.Channel( + w.source, + fsmhandler.NewObservedEventHandler(log, scheme, name, metrics, w.handler, w.triggerType), + w.opts..., + ) + + claimedBuilder.WatchesRawSource(src) } // custom controller builder options diff --git a/pkg/fsm/test/chan/chan_test.go b/pkg/fsm/test/chan/chan_test.go index abb4d2f..2291c69 100644 --- a/pkg/fsm/test/chan/chan_test.go +++ b/pkg/fsm/test/chan/chan_test.go @@ -1,150 +1,166 @@ package fsm_test -//import ( -// "context" -// "fmt" -// "sync/atomic" -// "testing" -// "time" -// -// . "github.com/onsi/ginkgo/v2" -// . "github.com/onsi/gomega" -// fsmtypes "github.com/reddit/achilles-sdk/pkg/fsm/types" -// "github.com/reddit/achilles-sdk/pkg/internal/tests/api/test/v1alpha1" -// "github.com/reddit/achilles-sdk/pkg/io" -// "go.uber.org/zap" -//) -// -//type state = fsmtypes.State[*v1alpha1.TestClaimed] -// -//func TestClaimControllerEnvtestIT(t *testing.T) { -// RegisterFailHandler(Fail) -// RunSpecs(t, "Claim Controller Suite") -//} -// -//const ( -// externalDataAnnotation = "test-annotation" -//) -// -//var ( -// // External data is written to claimed's annotations. -// // srcChan is used to trigger reconciliation when externalData changes -// externalData = "version_1" -//) -// -//type reconciler struct { -// log *zap.SugaredLogger -// c *io.ClientApplicator -// -// lastReconcileAt atomic.Value -//} -// -//func (r *reconciler) initialState() *state { -// return &state{ -// Name: "initial", -// Transition: func( -// ctx context.Context, -// claimed *v1alpha1.TestClaimed, -// out *fsmtypes.OutputSet, -// ) (*state, fsmtypes.Result) { -// r.lastReconcileAt.Store(time.Now()) -// if claimed.Annotations == nil { -// claimed.Annotations = make(map[string]string) -// } -// claimed.Annotations[externalDataAnnotation] = externalData -// if err := r.c.Update(ctx, claimed); err != nil { -// return nil, fsmtypes.ErrorResult(fmt.Errorf("updating status: %w", err)) -// } -// return nil, fsmtypes.DoneResult() -// }, -// } -//} -// -//var _ = Describe("Claim Controller", func() { -// -//It("watches raw sources", func(gctx context.Context) { -// log := zaptest.LoggerWriter(GinkgoWriter).Sugar() -// ctx := logging.NewContext(gctx, log) -// scheme := internalscheme.MustNewScheme() -// -// srcChan := make(chan event.GenericEvent, 10) -// -// var r *reconciler -// -// testEnv, err := test.NewEnvTestBuilder(ctx). -// WithCRDDirectoryPaths([]string{ -// filepath.Join(tests.RootDir(), "pkg", "internal", "tests", "cluster", "crd", "bases"), -// }). -// WithScheme(scheme). -// WithLog(log.Desugar()). -// WithManagerSetupFns( -// func(mgr manager.Manager) error { -// r = &reconciler{ -// log: log, -// c: &io.ClientApplicator{ -// Client: mgr.GetClient(), -// Applicator: io.NewAPIPatchingApplicator(mgr.GetClient()), -// }, -// lastReconcileAt: atomic.Value{}, -// } -// -// builder := fsm.NewClaimBuilder( -// &v1alpha1.TestClaimed{}, -// &v1alpha1.TestClaim{}, -// r.initialState(), -// mgr.GetScheme(), -// ).WatchesRawSource( -// source.Channel(srcChan, &handler.EnqueueRequestForObject{}), -// &handler.EnqueueRequestForObject{}, -// fsmhandler.TriggerTypeSelf, -// ) -// -// rl := libratelimiter.NewDefaultProviderRateLimiter(libratelimiter.DefaultProviderRPS) -// reg := prometheus.NewRegistry() -// metrics := metrics.MustMakeMetrics(scheme, reg) -// return builder.Build()(mgr, log, rl, metrics) -// }, -// ). -// Start() -// Expect(err).ToNot(HaveOccurred()) -// defer func() { Expect(testEnv.Stop()).To(Succeed()) }() -// c := testEnv.Client -// -// claim := &v1alpha1.TestClaim{} -// claim.Name = "test-claim" -// claim.Namespace = "default" -// Expect(c.Create(ctx, claim)).To(Succeed()) -// -// By("Waiting for claimed") -// claimed := &v1alpha1.TestClaimed{} -// Eventually(func(g Gomega) { -// actualClaim := &v1alpha1.TestClaim{} -// g.Expect(c.Get(ctx, client.ObjectKeyFromObject(claim), actualClaim)).ToNot(HaveOccurred()) -// g.Expect(actualClaim.Spec.ClaimedRef).ToNot(BeNil()) -// g.Expect(c.Get(ctx, actualClaim.Spec.ClaimedRef.ObjectKey(), claimed)).ToNot(HaveOccurred()) -// g.Expect(claimed.Annotations[externalDataAnnotation]).To(Equal("version_1")) -// }).WithTimeout(1 * time.Second).Should(Succeed()) -// -// By("Making sure reconciliations finished") -// Eventually(func(g Gomega) { -// g.Expect(r.lastReconcileAt.Load().(time.Time)). -// To(BeTemporally("<=", time.Now().Add(-1*time.Second))) -// }).WithTimeout(3 * time.Second).Should(Succeed()) -// -// By("Updating external data and making sure reconciliation is not triggered") -// claimed = claimed.DeepCopy() // avoid race -// externalData = "version_2" -// Consistently(func(g Gomega) { -// g.Expect(c.Get(ctx, client.ObjectKeyFromObject(claimed), claimed)).ToNot(HaveOccurred()) -// g.Expect(claimed.Annotations[externalDataAnnotation]).To(Equal("version_1")) -// }).WithTimeout(1 * time.Second).Should(Succeed()) -// -// By("Triggering reconciliation via events channel") -// claimed = claimed.DeepCopy() // avoid race -// srcChan <- event.GenericEvent{Object: claimed} -// Eventually(func(g Gomega) { -// g.Expect(c.Get(ctx, client.ObjectKeyFromObject(claimed), claimed)).ToNot(HaveOccurred()) -// g.Expect(claimed.Annotations[externalDataAnnotation]).To(Equal("version_2")) -// }).WithTimeout(1 * time.Second).Should(Succeed()) -//}) -//}) +import ( + "context" + "fmt" + "path/filepath" + "sync/atomic" + "testing" + "time" + + "github.com/fgrosse/zaptest" + . "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" + "github.com/prometheus/client_golang/prometheus" + "go.uber.org/zap" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/event" + "sigs.k8s.io/controller-runtime/pkg/handler" + "sigs.k8s.io/controller-runtime/pkg/manager" + + "github.com/reddit/achilles-sdk/pkg/fsm" + fsmhandler "github.com/reddit/achilles-sdk/pkg/fsm/handler" + "github.com/reddit/achilles-sdk/pkg/fsm/metrics" + fsmtypes "github.com/reddit/achilles-sdk/pkg/fsm/types" + internalscheme "github.com/reddit/achilles-sdk/pkg/internal/scheme" + "github.com/reddit/achilles-sdk/pkg/internal/tests" + "github.com/reddit/achilles-sdk/pkg/internal/tests/api/test/v1alpha1" + "github.com/reddit/achilles-sdk/pkg/io" + "github.com/reddit/achilles-sdk/pkg/logging" + libratelimiter "github.com/reddit/achilles-sdk/pkg/ratelimiter" + "github.com/reddit/achilles-sdk/pkg/test" +) + +type state = fsmtypes.State[*v1alpha1.TestClaimed] + +func TestClaimControllerEnvtestIT(t *testing.T) { + RegisterFailHandler(Fail) + RunSpecs(t, "Claim Controller Suite") +} + +const ( + externalDataAnnotation = "test-annotation" +) + +var ( + // External data is written to claimed's annotations. + // srcChan is used to trigger reconciliation when externalData changes + externalData = "version_1" +) + +type reconciler struct { + log *zap.SugaredLogger + c *io.ClientApplicator + + lastReconcileAt atomic.Value +} + +func (r *reconciler) initialState() *state { + return &state{ + Name: "initial", + Transition: func( + ctx context.Context, + claimed *v1alpha1.TestClaimed, + out *fsmtypes.OutputSet, + ) (*state, fsmtypes.Result) { + r.lastReconcileAt.Store(time.Now()) + if claimed.Annotations == nil { + claimed.Annotations = make(map[string]string) + } + claimed.Annotations[externalDataAnnotation] = externalData + if err := r.c.Update(ctx, claimed); err != nil { + return nil, fsmtypes.ErrorResult(fmt.Errorf("updating status: %w", err)) + } + return nil, fsmtypes.DoneResult() + }, + } +} + +var _ = Describe("Claim Controller", func() { + + It("watches raw sources", func(gctx context.Context) { + log := zaptest.LoggerWriter(GinkgoWriter).Sugar() + ctx := logging.NewContext(gctx, log) + scheme := internalscheme.MustNewScheme() + + srcChan := make(chan event.GenericEvent, 10) + + var r *reconciler + + testEnv, err := test.NewEnvTestBuilder(ctx). + WithCRDDirectoryPaths([]string{ + filepath.Join(tests.RootDir(), "pkg", "internal", "tests", "cluster", "crd", "bases"), + }). + WithScheme(scheme). + WithLog(log.Desugar()). + WithManagerSetupFns( + func(mgr manager.Manager) error { + r = &reconciler{ + log: log, + c: &io.ClientApplicator{ + Client: mgr.GetClient(), + Applicator: io.NewAPIPatchingApplicator(mgr.GetClient()), + }, + lastReconcileAt: atomic.Value{}, + } + + builder := fsm.NewClaimBuilder( + &v1alpha1.TestClaimed{}, + &v1alpha1.TestClaim{}, + r.initialState(), + mgr.GetScheme(), + ).WatchesChannel( + srcChan, + &handler.EnqueueRequestForObject{}, + fsmhandler.TriggerTypeSelf, + ) + + rl := libratelimiter.NewDefaultProviderRateLimiter(libratelimiter.DefaultProviderRPS) + reg := prometheus.NewRegistry() + metrics := metrics.MustMakeMetrics(scheme, reg) + return builder.Build()(mgr, log, rl, metrics) + }, + ). + Start() + Expect(err).ToNot(HaveOccurred()) + defer func() { Expect(testEnv.Stop()).To(Succeed()) }() + c := testEnv.Client + + claim := &v1alpha1.TestClaim{} + claim.Name = "test-claim" + claim.Namespace = "default" + Expect(c.Create(ctx, claim)).To(Succeed()) + + By("Waiting for claimed") + claimed := &v1alpha1.TestClaimed{} + Eventually(func(g Gomega) { + actualClaim := &v1alpha1.TestClaim{} + g.Expect(c.Get(ctx, client.ObjectKeyFromObject(claim), actualClaim)).ToNot(HaveOccurred()) + g.Expect(actualClaim.Spec.ClaimedRef).ToNot(BeNil()) + g.Expect(c.Get(ctx, actualClaim.Spec.ClaimedRef.ObjectKey(), claimed)).ToNot(HaveOccurred()) + g.Expect(claimed.Annotations[externalDataAnnotation]).To(Equal("version_1")) + }).WithTimeout(1 * time.Second).Should(Succeed()) + + By("Making sure reconciliations finished") + Eventually(func(g Gomega) { + g.Expect(r.lastReconcileAt.Load().(time.Time)). + To(BeTemporally("<=", time.Now().Add(-1*time.Second))) + }).WithTimeout(3 * time.Second).Should(Succeed()) + + By("Updating external data and making sure reconciliation is not triggered") + claimed = claimed.DeepCopy() // avoid race + externalData = "version_2" + Consistently(func(g Gomega) { + g.Expect(c.Get(ctx, client.ObjectKeyFromObject(claimed), claimed)).ToNot(HaveOccurred()) + g.Expect(claimed.Annotations[externalDataAnnotation]).To(Equal("version_1")) + }).WithTimeout(1 * time.Second).Should(Succeed()) + + By("Triggering reconciliation via events channel") + claimed = claimed.DeepCopy() // avoid race + srcChan <- event.GenericEvent{Object: claimed} + Eventually(func(g Gomega) { + g.Expect(c.Get(ctx, client.ObjectKeyFromObject(claimed), claimed)).ToNot(HaveOccurred()) + g.Expect(claimed.Annotations[externalDataAnnotation]).To(Equal("version_2")) + }).WithTimeout(1 * time.Second).Should(Succeed()) + }) +}) diff --git a/pkg/internal/tests/api/test/v1alpha1/zz_generated.deepcopy.go b/pkg/internal/tests/api/test/v1alpha1/zz_generated.deepcopy.go index 70f62f4..2edd157 100644 --- a/pkg/internal/tests/api/test/v1alpha1/zz_generated.deepcopy.go +++ b/pkg/internal/tests/api/test/v1alpha1/zz_generated.deepcopy.go @@ -5,8 +5,9 @@ package v1alpha1 import ( - "github.com/reddit/achilles-sdk-api/api" runtime "k8s.io/apimachinery/pkg/runtime" + + "github.com/reddit/achilles-sdk-api/api" ) // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. From 94cac894c3c17dfc4c002885cd072967f249f6ae Mon Sep 17 00:00:00 2001 From: shadialtarsha Date: Tue, 14 Jan 2025 12:44:59 +0100 Subject: [PATCH 03/17] update Go version --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index c4bedaa..da493ef 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -12,7 +12,7 @@ jobs: strategy: matrix: go-version: - - "1.22" + - "1.23" container: image: golang:${{ matrix.go-version }} From c998137336d24debdaffd5ae8bd4eb7158369e70 Mon Sep 17 00:00:00 2001 From: shadialtarsha Date: Fri, 17 Jan 2025 12:05:30 +0100 Subject: [PATCH 04/17] fixing chan_test.go --- pkg/fsm/test/chan/chan_test.go | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/pkg/fsm/test/chan/chan_test.go b/pkg/fsm/test/chan/chan_test.go index 2291c69..479a7c2 100644 --- a/pkg/fsm/test/chan/chan_test.go +++ b/pkg/fsm/test/chan/chan_test.go @@ -4,6 +4,7 @@ import ( "context" "fmt" "path/filepath" + "sync" "sync/atomic" "testing" "time" @@ -46,6 +47,7 @@ var ( // External data is written to claimed's annotations. // srcChan is used to trigger reconciliation when externalData changes externalData = "version_1" + mu sync.Mutex ) type reconciler struct { @@ -67,7 +69,11 @@ func (r *reconciler) initialState() *state { if claimed.Annotations == nil { claimed.Annotations = make(map[string]string) } + + mu.Lock() claimed.Annotations[externalDataAnnotation] = externalData + mu.Unlock() + if err := r.c.Update(ctx, claimed); err != nil { return nil, fsmtypes.ErrorResult(fmt.Errorf("updating status: %w", err)) } @@ -143,24 +149,28 @@ var _ = Describe("Claim Controller", func() { By("Making sure reconciliations finished") Eventually(func(g Gomega) { - g.Expect(r.lastReconcileAt.Load().(time.Time)). - To(BeTemporally("<=", time.Now().Add(-1*time.Second))) - }).WithTimeout(3 * time.Second).Should(Succeed()) + mu.Lock() + lastReconcile := r.lastReconcileAt.Load().(time.Time) + passedTime := time.Now().Add(-3 * time.Second) + mu.Unlock() + g.Expect(lastReconcile).To(BeTemporally("<=", passedTime)) + }).WithTimeout(10 * time.Second).Should(Succeed()) By("Updating external data and making sure reconciliation is not triggered") - claimed = claimed.DeepCopy() // avoid race - externalData = "version_2" + Consistently(func(g Gomega) { + externalData = "version_2" + claimed = claimed.DeepCopy() // avoid race g.Expect(c.Get(ctx, client.ObjectKeyFromObject(claimed), claimed)).ToNot(HaveOccurred()) g.Expect(claimed.Annotations[externalDataAnnotation]).To(Equal("version_1")) }).WithTimeout(1 * time.Second).Should(Succeed()) By("Triggering reconciliation via events channel") - claimed = claimed.DeepCopy() // avoid race srcChan <- event.GenericEvent{Object: claimed} Eventually(func(g Gomega) { + claimed = claimed.DeepCopy() // avoid race g.Expect(c.Get(ctx, client.ObjectKeyFromObject(claimed), claimed)).ToNot(HaveOccurred()) g.Expect(claimed.Annotations[externalDataAnnotation]).To(Equal("version_2")) - }).WithTimeout(1 * time.Second).Should(Succeed()) + }).WithTimeout(5 * time.Second).Should(Succeed()) }) }) From f7a19e037452b44f6f0e83440e4a68d0247a67ef Mon Sep 17 00:00:00 2001 From: shadialtarsha Date: Fri, 24 Jan 2025 12:53:26 +0100 Subject: [PATCH 05/17] CR fixes --- pkg/fsm/builder.go | 50 +++++++++------------------------- pkg/fsm/claim_builder.go | 41 ++++++++-------------------- pkg/fsm/test/chan/chan_test.go | 8 ++---- 3 files changed, 27 insertions(+), 72 deletions(-) diff --git a/pkg/fsm/builder.go b/pkg/fsm/builder.go index c025675..0a102c8 100644 --- a/pkg/fsm/builder.go +++ b/pkg/fsm/builder.go @@ -13,7 +13,6 @@ import ( "sigs.k8s.io/controller-runtime/pkg/cache" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/controller" - "sigs.k8s.io/controller-runtime/pkg/event" "sigs.k8s.io/controller-runtime/pkg/handler" "sigs.k8s.io/controller-runtime/pkg/predicate" "sigs.k8s.io/controller-runtime/pkg/reconcile" @@ -59,8 +58,8 @@ type Builder[T any, Obj apitypes.FSMResource[T]] struct { managedTypes []schema.GroupVersionKind controllerFns []ControllerFunc watches []watch - watchKinds []watchKind - watchChannels []watchChannel + watchRemoteKinds []watchRemoteKind + watchSources []source.Source opts []buildOption maxConcurrentReconciles int reconcilerOptions fsmtypes.ReconcilerOptions[T, Obj] @@ -73,7 +72,7 @@ type watch struct { triggerType fsmhandler.TriggerType } -type watchKind struct { +type watchRemoteKind struct { cache cache.Cache obj client.Object handler handler.EventHandler @@ -81,13 +80,6 @@ type watchKind struct { triggerType fsmhandler.TriggerType } -type watchChannel struct { - source <-chan event.GenericEvent - handler handler.EventHandler - triggerType fsmhandler.TriggerType - opts []source.ChannelOpt[client.Object, reconcile.Request] -} - // NewBuilder returns a builder that builds a function wiring up a logical FSM controller to a manager. // Obj is the object being reconciled and initialState is the initial state in the finite state machine, func NewBuilder[T any, Obj apitypes.FSMResource[T]]( @@ -159,16 +151,16 @@ func (b *Builder[T, Obj]) Watches( return b } -// WatchesKind adds a new watch to the controller for a specific kind. -// Use this method for events originating in the cluster. -func (b *Builder[T, Obj]) WatchesKind( +// WatchesRemoteKind adds a new watch to the controller for a specific kind located in a remote cluster. +// The remote cluster is specified through cache.Cache. +func (b *Builder[T, Obj]) WatchesRemoteKind( cache cache.Cache, obj client.Object, handler handler.EventHandler, triggerType fsmhandler.TriggerType, predicates ...predicate.Predicate, ) *Builder[T, Obj] { - b.watchKinds = append(b.watchKinds, watchKind{ + b.watchRemoteKinds = append(b.watchRemoteKinds, watchRemoteKind{ cache: cache, obj: obj, handler: handler, @@ -178,19 +170,9 @@ func (b *Builder[T, Obj]) WatchesKind( return b } -// WatchesChannel adds a new watch to the controller for events originating outside the cluster. -func (b *Builder[T, Obj]) WatchesChannel( - source <-chan event.GenericEvent, - handler handler.EventHandler, - triggerType fsmhandler.TriggerType, - opts ...source.ChannelOpt[client.Object, reconcile.Request], -) *Builder[T, Obj] { - b.watchChannels = append(b.watchChannels, watchChannel{ - source: source, - handler: handler, - triggerType: triggerType, - opts: opts, - }) +// WatchesSource adds a new watch to the controller for events originating outside the cluster. +func (b *Builder[T, Obj]) WatchesSource(src source.Source) *Builder[T, Obj] { + b.watchSources = append(b.watchSources, src) return b } @@ -261,7 +243,7 @@ func (b *Builder[T, Obj]) Build() SetupFunc { ) } - for _, w := range b.watchKinds { + for _, w := range b.watchRemoteKinds { src := source.Kind( w.cache, w.obj, @@ -272,14 +254,8 @@ func (b *Builder[T, Obj]) Build() SetupFunc { builder.WatchesRawSource(src) } - for _, w := range b.watchChannels { - src := source.Channel( - w.source, - fsmhandler.NewObservedEventHandler(log, scheme, name, metrics, w.handler, w.triggerType), - w.opts..., - ) - - builder.WatchesRawSource(src) + for _, w := range b.watchSources { + builder.WatchesRawSource(w) } // custom controller builder options diff --git a/pkg/fsm/claim_builder.go b/pkg/fsm/claim_builder.go index c392874..71d802c 100644 --- a/pkg/fsm/claim_builder.go +++ b/pkg/fsm/claim_builder.go @@ -14,7 +14,6 @@ import ( "sigs.k8s.io/controller-runtime/pkg/cache" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/controller" - "sigs.k8s.io/controller-runtime/pkg/event" "sigs.k8s.io/controller-runtime/pkg/handler" "sigs.k8s.io/controller-runtime/pkg/predicate" "sigs.k8s.io/controller-runtime/pkg/reconcile" @@ -41,8 +40,8 @@ type ClaimBuilder[T any, U any, ClaimedType apitypes.ClaimedType[T], ClaimType a managedTypes []schema.GroupVersionKind controllerFns []ControllerFunc watches []watch - watchKinds []watchKind - watchChannels []watchChannel + watchRemoteKinds []watchRemoteKind + watchSources []source.Source opts []buildOption maxConcurrentReconciles int } @@ -123,16 +122,16 @@ func (b *ClaimBuilder[T, U, ClaimedType, ClaimType]) Watches( return b } -// WatchesKind adds a new watch to the controller for a specific kind. -// Use this method for events originating in the cluster. -func (b *ClaimBuilder[T, U, ClaimedType, ClaimType]) WatchesKind( +// WatchesRemoteKind adds a new watch to the controller for a specific kind located in a remote cluster. +// The remote cluster is specified through cache.Cache. +func (b *ClaimBuilder[T, U, ClaimedType, ClaimType]) WatchesRemoteKind( cache cache.Cache, obj client.Object, handler handler.EventHandler, triggerType fsmhandler.TriggerType, predicates ...predicate.Predicate, ) *ClaimBuilder[T, U, ClaimedType, ClaimType] { - b.watchKinds = append(b.watchKinds, watchKind{ + b.watchRemoteKinds = append(b.watchRemoteKinds, watchRemoteKind{ cache: cache, obj: obj, handler: handler, @@ -142,19 +141,9 @@ func (b *ClaimBuilder[T, U, ClaimedType, ClaimType]) WatchesKind( return b } -// WatchesChannel adds a new watch to the controller for events originating outside the cluster. -func (b *ClaimBuilder[T, U, ClaimedType, ClaimType]) WatchesChannel( - source <-chan event.GenericEvent, - handler handler.EventHandler, - triggerType fsmhandler.TriggerType, - opts ...source.ChannelOpt[client.Object, reconcile.Request], -) *ClaimBuilder[T, U, ClaimedType, ClaimType] { - b.watchChannels = append(b.watchChannels, watchChannel{ - source: source, - handler: handler, - triggerType: triggerType, - opts: opts, - }) +// WatchesSource adds a new watch to the controller for events originating outside the cluster. +func (b *ClaimBuilder[T, U, ClaimedType, ClaimType]) WatchesSource(src source.Source) *ClaimBuilder[T, U, ClaimedType, ClaimType] { + b.watchSources = append(b.watchSources, src) return b } @@ -282,7 +271,7 @@ func (b *ClaimBuilder[T, U, ClaimedType, ClaimType]) Build() SetupFunc { ) } - for _, w := range b.watchKinds { + for _, w := range b.watchRemoteKinds { src := source.Kind( w.cache, w.obj, @@ -293,14 +282,8 @@ func (b *ClaimBuilder[T, U, ClaimedType, ClaimType]) Build() SetupFunc { claimedBuilder.WatchesRawSource(src) } - for _, w := range b.watchChannels { - src := source.Channel( - w.source, - fsmhandler.NewObservedEventHandler(log, scheme, name, metrics, w.handler, w.triggerType), - w.opts..., - ) - - claimedBuilder.WatchesRawSource(src) + for _, w := range b.watchSources { + claimedBuilder.WatchesRawSource(w) } // custom controller builder options diff --git a/pkg/fsm/test/chan/chan_test.go b/pkg/fsm/test/chan/chan_test.go index 479a7c2..e8852f9 100644 --- a/pkg/fsm/test/chan/chan_test.go +++ b/pkg/fsm/test/chan/chan_test.go @@ -18,9 +18,9 @@ import ( "sigs.k8s.io/controller-runtime/pkg/event" "sigs.k8s.io/controller-runtime/pkg/handler" "sigs.k8s.io/controller-runtime/pkg/manager" + "sigs.k8s.io/controller-runtime/pkg/source" "github.com/reddit/achilles-sdk/pkg/fsm" - fsmhandler "github.com/reddit/achilles-sdk/pkg/fsm/handler" "github.com/reddit/achilles-sdk/pkg/fsm/metrics" fsmtypes "github.com/reddit/achilles-sdk/pkg/fsm/types" internalscheme "github.com/reddit/achilles-sdk/pkg/internal/scheme" @@ -115,11 +115,7 @@ var _ = Describe("Claim Controller", func() { &v1alpha1.TestClaim{}, r.initialState(), mgr.GetScheme(), - ).WatchesChannel( - srcChan, - &handler.EnqueueRequestForObject{}, - fsmhandler.TriggerTypeSelf, - ) + ).WatchesSource(source.Channel(srcChan, &handler.EnqueueRequestForObject{})) rl := libratelimiter.NewDefaultProviderRateLimiter(libratelimiter.DefaultProviderRPS) reg := prometheus.NewRegistry() From 9c5a2304dfb8ccea7901d6583b1db4291294b216 Mon Sep 17 00:00:00 2001 From: shadialtarsha Date: Fri, 24 Jan 2025 13:00:32 +0100 Subject: [PATCH 06/17] CR fixes --- tools/go.sum | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/go.sum b/tools/go.sum index 9e463e3..663f178 100644 --- a/tools/go.sum +++ b/tools/go.sum @@ -102,6 +102,7 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= From 0c329057e35de12b64f7a1ac44465f476eed8f88 Mon Sep 17 00:00:00 2001 From: shadialtarsha Date: Fri, 24 Jan 2025 13:53:11 +0100 Subject: [PATCH 07/17] run make lint --- tools/go.sum | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/go.sum b/tools/go.sum index 663f178..9e463e3 100644 --- a/tools/go.sum +++ b/tools/go.sum @@ -102,7 +102,6 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= From a035e576b8229a9aa9cf828c925682fcab09f8d4 Mon Sep 17 00:00:00 2001 From: shadialtarsha Date: Fri, 24 Jan 2025 13:58:09 +0100 Subject: [PATCH 08/17] fix import --- go.mod | 1 + 1 file changed, 1 insertion(+) diff --git a/go.mod b/go.mod index 7bd739f..cd2dbf6 100644 --- a/go.mod +++ b/go.mod @@ -52,6 +52,7 @@ require ( github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/klauspost/compress v1.17.9 // indirect + github.com/kylelemons/godebug v1.1.0 // indirect github.com/mailru/easyjson v0.7.7 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect From 6e34e2fd06d64376d3bde08fc4ed109be68bc945 Mon Sep 17 00:00:00 2001 From: shadialtarsha Date: Fri, 24 Jan 2025 15:37:36 +0100 Subject: [PATCH 09/17] increase the e2e eventual consistency --- go.mod | 5 ++--- go.sum | 8 ++++---- pkg/fsm/internal/test/core/controller_suite_test.go | 2 +- .../tests/api/test/v1alpha1/zz_generated.deepcopy.go | 3 +-- 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/go.mod b/go.mod index cd2dbf6..f2c4674 100644 --- a/go.mod +++ b/go.mod @@ -52,7 +52,6 @@ require ( github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/klauspost/compress v1.17.9 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect github.com/mailru/easyjson v0.7.7 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect @@ -60,13 +59,13 @@ require ( github.com/onsi/ginkgo v1.16.5 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect - github.com/prometheus/common v0.55.0 // indirect + github.com/prometheus/common v0.62.0 // indirect github.com/prometheus/procfs v0.15.1 // indirect github.com/x448/float16 v0.8.4 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/mod v0.22.0 // indirect golang.org/x/net v0.34.0 // indirect - golang.org/x/oauth2 v0.23.0 // indirect + golang.org/x/oauth2 v0.24.0 // indirect golang.org/x/sys v0.29.0 // indirect golang.org/x/term v0.28.0 // indirect golang.org/x/text v0.21.0 // indirect diff --git a/go.sum b/go.sum index 997ad66..5b80655 100644 --- a/go.sum +++ b/go.sum @@ -109,8 +109,8 @@ github.com/prometheus/client_golang v1.20.5 h1:cxppBPuYhUnsO6yo/aoRol4L7q7UFfdm+ github.com/prometheus/client_golang v1.20.5/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= -github.com/prometheus/common v0.55.0 h1:KEi6DK7lXW/m7Ig5i47x0vRzuBsHuvJdi5ee6Y3G1dc= -github.com/prometheus/common v0.55.0/go.mod h1:2SECS4xJG1kd8XF9IcM1gMX6510RAEL65zxzNImwdc8= +github.com/prometheus/common v0.62.0 h1:xasJaQlnWAeyHdUBeGjXmutelfJHWMRr+Fg4QszZ2Io= +github.com/prometheus/common v0.62.0/go.mod h1:vyBcEuLSvWos9B1+CyL7JZ2up+uFzXhkqml0W5zIY1I= github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/reddit/achilles-sdk-api v1.1.1 h1:H8KmxA6nMgOhUjKnw3BgxqC0qft8+/I9ZobCDNgDPwA= @@ -156,8 +156,8 @@ golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/ golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0= golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k= -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-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= diff --git a/pkg/fsm/internal/test/core/controller_suite_test.go b/pkg/fsm/internal/test/core/controller_suite_test.go index 50aeda7..5418fb5 100644 --- a/pkg/fsm/internal/test/core/controller_suite_test.go +++ b/pkg/fsm/internal/test/core/controller_suite_test.go @@ -41,7 +41,7 @@ var ( ) var _ = BeforeSuite(func() { - SetDefaultEventuallyTimeout(15 * time.Second) + SetDefaultEventuallyTimeout(75 * time.Second) SetDefaultEventuallyPollingInterval(200 * time.Millisecond) log = zaptest.LoggerWriter(GinkgoWriter).Sugar() diff --git a/pkg/internal/tests/api/test/v1alpha1/zz_generated.deepcopy.go b/pkg/internal/tests/api/test/v1alpha1/zz_generated.deepcopy.go index 2edd157..70f62f4 100644 --- a/pkg/internal/tests/api/test/v1alpha1/zz_generated.deepcopy.go +++ b/pkg/internal/tests/api/test/v1alpha1/zz_generated.deepcopy.go @@ -5,9 +5,8 @@ package v1alpha1 import ( - runtime "k8s.io/apimachinery/pkg/runtime" - "github.com/reddit/achilles-sdk-api/api" + runtime "k8s.io/apimachinery/pkg/runtime" ) // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. From 6813b1524904f6f9e3ecdee353d5d3da6efd7f8d Mon Sep 17 00:00:00 2001 From: shadialtarsha Date: Fri, 24 Jan 2025 15:45:26 +0100 Subject: [PATCH 10/17] run make lint --- pkg/internal/tests/api/test/v1alpha1/zz_generated.deepcopy.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/internal/tests/api/test/v1alpha1/zz_generated.deepcopy.go b/pkg/internal/tests/api/test/v1alpha1/zz_generated.deepcopy.go index 70f62f4..2edd157 100644 --- a/pkg/internal/tests/api/test/v1alpha1/zz_generated.deepcopy.go +++ b/pkg/internal/tests/api/test/v1alpha1/zz_generated.deepcopy.go @@ -5,8 +5,9 @@ package v1alpha1 import ( - "github.com/reddit/achilles-sdk-api/api" runtime "k8s.io/apimachinery/pkg/runtime" + + "github.com/reddit/achilles-sdk-api/api" ) // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. From 37715694bdad91bbc1712f3f8efae5a21a34f26c Mon Sep 17 00:00:00 2001 From: shadialtarsha Date: Fri, 24 Jan 2025 15:58:52 +0100 Subject: [PATCH 11/17] fix generate --- go.mod | 1 + 1 file changed, 1 insertion(+) diff --git a/go.mod b/go.mod index f2c4674..088e639 100644 --- a/go.mod +++ b/go.mod @@ -52,6 +52,7 @@ require ( github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/klauspost/compress v1.17.9 // indirect + github.com/kylelemons/godebug v1.1.0 // indirect github.com/mailru/easyjson v0.7.7 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect From 77874aa6ad11e32ad4cf1cd9eb83a344ca6b05e8 Mon Sep 17 00:00:00 2001 From: shadialtarsha Date: Fri, 24 Jan 2025 16:28:36 +0100 Subject: [PATCH 12/17] WatchesRawSource instead of WatchesSource --- pkg/fsm/builder.go | 10 +++++----- pkg/fsm/claim_builder.go | 10 +++++----- pkg/fsm/test/chan/chan_test.go | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/pkg/fsm/builder.go b/pkg/fsm/builder.go index 0a102c8..4714441 100644 --- a/pkg/fsm/builder.go +++ b/pkg/fsm/builder.go @@ -59,7 +59,7 @@ type Builder[T any, Obj apitypes.FSMResource[T]] struct { controllerFns []ControllerFunc watches []watch watchRemoteKinds []watchRemoteKind - watchSources []source.Source + watchRawSources []source.Source opts []buildOption maxConcurrentReconciles int reconcilerOptions fsmtypes.ReconcilerOptions[T, Obj] @@ -170,9 +170,9 @@ func (b *Builder[T, Obj]) WatchesRemoteKind( return b } -// WatchesSource adds a new watch to the controller for events originating outside the cluster. -func (b *Builder[T, Obj]) WatchesSource(src source.Source) *Builder[T, Obj] { - b.watchSources = append(b.watchSources, src) +// WatchesRawSource adds a new watch to the controller for events originating outside the cluster. +func (b *Builder[T, Obj]) WatchesRawSource(src source.Source) *Builder[T, Obj] { + b.watchRawSources = append(b.watchRawSources, src) return b } @@ -254,7 +254,7 @@ func (b *Builder[T, Obj]) Build() SetupFunc { builder.WatchesRawSource(src) } - for _, w := range b.watchSources { + for _, w := range b.watchRawSources { builder.WatchesRawSource(w) } diff --git a/pkg/fsm/claim_builder.go b/pkg/fsm/claim_builder.go index 71d802c..bb06295 100644 --- a/pkg/fsm/claim_builder.go +++ b/pkg/fsm/claim_builder.go @@ -41,7 +41,7 @@ type ClaimBuilder[T any, U any, ClaimedType apitypes.ClaimedType[T], ClaimType a controllerFns []ControllerFunc watches []watch watchRemoteKinds []watchRemoteKind - watchSources []source.Source + watchRawSources []source.Source opts []buildOption maxConcurrentReconciles int } @@ -141,9 +141,9 @@ func (b *ClaimBuilder[T, U, ClaimedType, ClaimType]) WatchesRemoteKind( return b } -// WatchesSource adds a new watch to the controller for events originating outside the cluster. -func (b *ClaimBuilder[T, U, ClaimedType, ClaimType]) WatchesSource(src source.Source) *ClaimBuilder[T, U, ClaimedType, ClaimType] { - b.watchSources = append(b.watchSources, src) +// WatchesRawSource adds a new watch to the controller for events originating outside the cluster. +func (b *ClaimBuilder[T, U, ClaimedType, ClaimType]) WatchesRawSource(src source.Source) *ClaimBuilder[T, U, ClaimedType, ClaimType] { + b.watchRawSources = append(b.watchRawSources, src) return b } @@ -282,7 +282,7 @@ func (b *ClaimBuilder[T, U, ClaimedType, ClaimType]) Build() SetupFunc { claimedBuilder.WatchesRawSource(src) } - for _, w := range b.watchSources { + for _, w := range b.watchRawSources { claimedBuilder.WatchesRawSource(w) } diff --git a/pkg/fsm/test/chan/chan_test.go b/pkg/fsm/test/chan/chan_test.go index e8852f9..1bef8c8 100644 --- a/pkg/fsm/test/chan/chan_test.go +++ b/pkg/fsm/test/chan/chan_test.go @@ -115,7 +115,7 @@ var _ = Describe("Claim Controller", func() { &v1alpha1.TestClaim{}, r.initialState(), mgr.GetScheme(), - ).WatchesSource(source.Channel(srcChan, &handler.EnqueueRequestForObject{})) + ).WatchesRawSource(source.Channel(srcChan, &handler.EnqueueRequestForObject{})) rl := libratelimiter.NewDefaultProviderRateLimiter(libratelimiter.DefaultProviderRPS) reg := prometheus.NewRegistry() From ed8157982ea504582b82cbe25df950c89d808d4b Mon Sep 17 00:00:00 2001 From: shadialtarsha Date: Fri, 24 Jan 2025 17:17:44 +0100 Subject: [PATCH 13/17] Update to 20 --- go.mod | 4 ++-- go.sum | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index 088e639..ad57e4d 100644 --- a/go.mod +++ b/go.mod @@ -25,7 +25,7 @@ require ( k8s.io/apimachinery v0.32.0 k8s.io/client-go v0.32.0 k8s.io/utils v0.0.0-20241210054802-24370beab758 - sigs.k8s.io/controller-runtime v0.19.4 + sigs.k8s.io/controller-runtime v0.20.1 sigs.k8s.io/yaml v1.4.0 ) @@ -45,6 +45,7 @@ require ( github.com/go-task/slim-sprig/v3 v3.0.0 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/protobuf v1.5.4 // indirect + github.com/google/btree v1.1.3 // indirect github.com/google/gnostic-models v0.6.8 // indirect github.com/google/gofuzz v1.2.0 // indirect github.com/google/pprof v0.0.0-20241210010833-40e02aabc2ad // indirect @@ -52,7 +53,6 @@ require ( github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/klauspost/compress v1.17.9 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect github.com/mailru/easyjson v0.7.7 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect diff --git a/go.sum b/go.sum index 5b80655..035350a 100644 --- a/go.sum +++ b/go.sum @@ -46,6 +46,8 @@ github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvq github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= +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/gnostic-models v0.6.8 h1:yo/ABAfM5IMRsS1VnXjTBvUb61tFIHozhlYvRgGre9I= github.com/google/gnostic-models v0.6.8/go.mod h1:5n7qKqH0f5wFt+aWF8CW6pZLLNOfYuF5OpfBSENuI8U= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= @@ -234,8 +236,8 @@ k8s.io/kube-openapi v0.0.0-20241105132330-32ad38e42d3f h1:GA7//TjRY9yWGy1poLzYYJ k8s.io/kube-openapi v0.0.0-20241105132330-32ad38e42d3f/go.mod h1:R/HEjbvWI0qdfb8viZUeVZm0X6IZnxAydC7YU42CMw4= k8s.io/utils v0.0.0-20241210054802-24370beab758 h1:sdbE21q2nlQtFh65saZY+rRM6x6aJJI8IUa1AmH/qa0= k8s.io/utils v0.0.0-20241210054802-24370beab758/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= -sigs.k8s.io/controller-runtime v0.19.4 h1:SUmheabttt0nx8uJtoII4oIP27BVVvAKFvdvGFwV/Qo= -sigs.k8s.io/controller-runtime v0.19.4/go.mod h1:iRmWllt8IlaLjvTTDLhRBXIEtkCK6hwVBJJsYS9Ajf4= +sigs.k8s.io/controller-runtime v0.20.1 h1:JbGMAG/X94NeM3xvjenVUaBjy6Ui4Ogd/J5ZtjZnHaE= +sigs.k8s.io/controller-runtime v0.20.1/go.mod h1:BrP3w158MwvB3ZbNpaAcIKkHQ7YGpYnzpoSTZ8E14WU= sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3 h1:/Rv+M11QRah1itp8VhT6HoVx1Ray9eB4DBr+K+/sCJ8= sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3/go.mod h1:18nIHnGi6636UCz6m8i4DhaJ65T6EruyzmoQqI2BVDo= sigs.k8s.io/structured-merge-diff/v4 v4.4.2 h1:MdmvkGuXi/8io6ixD5wud3vOLwc1rj0aNqRlpuvjmwA= From d37ef57493309317e730462ed581019e0791e0f9 Mon Sep 17 00:00:00 2001 From: shadialtarsha Date: Fri, 24 Jan 2025 17:22:18 +0100 Subject: [PATCH 14/17] comment update --- pkg/fsm/builder.go | 3 +++ pkg/fsm/claim_builder.go | 3 +++ 2 files changed, 6 insertions(+) diff --git a/pkg/fsm/builder.go b/pkg/fsm/builder.go index 4714441..b18788c 100644 --- a/pkg/fsm/builder.go +++ b/pkg/fsm/builder.go @@ -171,6 +171,9 @@ func (b *Builder[T, Obj]) WatchesRemoteKind( } // WatchesRawSource adds a new watch to the controller for events originating outside the cluster. +// +// This watch doesn't wrap the event handler with the FSM handler, so it's up to the caller to do so. You can use the +// fsmhandler.NewObservedEventHandler to wrap the handler with the FSM handler. func (b *Builder[T, Obj]) WatchesRawSource(src source.Source) *Builder[T, Obj] { b.watchRawSources = append(b.watchRawSources, src) return b diff --git a/pkg/fsm/claim_builder.go b/pkg/fsm/claim_builder.go index bb06295..d2c2349 100644 --- a/pkg/fsm/claim_builder.go +++ b/pkg/fsm/claim_builder.go @@ -142,6 +142,9 @@ func (b *ClaimBuilder[T, U, ClaimedType, ClaimType]) WatchesRemoteKind( } // WatchesRawSource adds a new watch to the controller for events originating outside the cluster. +// +// This watch doesn't wrap the event handler with the FSM handler, so it's up to the caller to do so. You can use the +// fsmhandler.NewObservedEventHandler to wrap the handler with the FSM handler. func (b *ClaimBuilder[T, U, ClaimedType, ClaimType]) WatchesRawSource(src source.Source) *ClaimBuilder[T, U, ClaimedType, ClaimType] { b.watchRawSources = append(b.watchRawSources, src) return b From da1e0a6fc80f09481a1c02bc793ac6c5f9548a90 Mon Sep 17 00:00:00 2001 From: shadialtarsha Date: Mon, 27 Jan 2025 16:01:31 +0100 Subject: [PATCH 15/17] remove gochain --- tools/go.mod | 2 -- 1 file changed, 2 deletions(-) diff --git a/tools/go.mod b/tools/go.mod index 72f9c09..817ebd5 100644 --- a/tools/go.mod +++ b/tools/go.mod @@ -2,8 +2,6 @@ module tools go 1.23.0 -toolchain go1.23.4 - require ( github.com/clamoriniere/crd-to-markdown v0.0.3 github.com/rinchsan/gosimports v0.3.8 From 4c9e6fd415a922d576046a1f630d8255ffc95abe Mon Sep 17 00:00:00 2001 From: shadialtarsha Date: Mon, 27 Jan 2025 16:08:43 +0100 Subject: [PATCH 16/17] add missing modul --- go.mod | 1 + 1 file changed, 1 insertion(+) diff --git a/go.mod b/go.mod index ad57e4d..ecc026c 100644 --- a/go.mod +++ b/go.mod @@ -53,6 +53,7 @@ require ( github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/klauspost/compress v1.17.9 // indirect + github.com/kylelemons/godebug v1.1.0 // indirect github.com/mailru/easyjson v0.7.7 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect From 3b640cb9377c2da5fbc762f878aee3289ec2f4d7 Mon Sep 17 00:00:00 2001 From: Shadi Altarsha <61504589+shadialtarsha@users.noreply.github.com> Date: Mon, 27 Jan 2025 16:25:40 +0100 Subject: [PATCH 17/17] Update pkg/ratelimiter/ratelimit.go Co-authored-by: Harvey Xia --- pkg/ratelimiter/ratelimit.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/ratelimiter/ratelimit.go b/pkg/ratelimiter/ratelimit.go index 3bb8f54..128f20f 100644 --- a/pkg/ratelimiter/ratelimit.go +++ b/pkg/ratelimiter/ratelimit.go @@ -17,6 +17,7 @@ const ( // NewGlobal returns a token bucket rate limiter meant for limiting the number // of average total requeues per second for all controllers registered with a // controller manager. The bucket size (i.e. allowed burst) is rps * 10. +// Note that the type parameter is ignored here. The rate limit is global. func NewGlobal(rps int) *workqueue.TypedBucketRateLimiter[reconcile.Request] { return &workqueue.TypedBucketRateLimiter[reconcile.Request]{ Limiter: rate.NewLimiter(rate.Limit(rps), rps*10), // burst = rps * 10