diff --git a/go.mod b/go.mod index 066a9523..193c056d 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/stretchr/testify v1.11.1 golang.org/x/crypto v0.46.0 golang.org/x/sync v0.19.0 - helm.sh/helm/v3 v3.19.4 + helm.sh/helm/v4 v4.0.4 k8s.io/api v0.35.0 k8s.io/apiextensions-apiserver v0.35.0 k8s.io/apimachinery v0.35.0 @@ -38,6 +38,7 @@ require ( github.com/Masterminds/semver/v3 v3.4.0 // indirect github.com/Masterminds/sprig/v3 v3.3.0 // indirect github.com/Masterminds/squirrel v1.5.4 // indirect + github.com/ProtonMail/go-crypto v1.3.0 // indirect github.com/antlr4-go/antlr/v4 v4.13.1 // indirect github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect github.com/beorn7/perks v1.0.1 // indirect @@ -45,21 +46,21 @@ require ( github.com/cenkalti/backoff/v5 v5.0.3 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/chai2010/gettext-go v1.0.2 // indirect - github.com/containerd/containerd v1.7.29 // indirect - github.com/containerd/errdefs v0.3.0 // indirect - github.com/containerd/log v0.1.0 // indirect - github.com/containerd/platforms v0.2.1 // indirect + github.com/cloudflare/circl v1.6.1 // indirect github.com/coreos/go-semver v0.3.1 // indirect github.com/coreos/go-systemd/v22 v22.5.0 // indirect github.com/cyphar/filepath-securejoin v0.6.1 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect + github.com/dylibso/observe-sdk/go v0.0.0-20240819160327-2d926c5d788a // indirect github.com/emicklei/go-restful/v3 v3.13.0 // indirect github.com/evanphx/json-patch v5.9.11+incompatible // indirect github.com/evanphx/json-patch/v5 v5.9.11 // indirect github.com/exponent-io/jsonpath v0.0.0-20210407135951-1de76d718b3f // indirect + github.com/extism/go-sdk v1.7.1 // indirect github.com/fatih/camelcase v1.0.0 // indirect github.com/fatih/color v1.18.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect + github.com/fluxcd/cli-utils v0.36.0-flux.14 // indirect github.com/fsnotify/fsnotify v1.9.0 // indirect github.com/fxamacker/cbor/v2 v2.9.0 // indirect github.com/go-asn1-ber/asn1-ber v1.5.8-0.20250403174932-29230038a667 // indirect @@ -84,14 +85,12 @@ require ( github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79 // indirect github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 // indirect github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.1 // indirect - github.com/hashicorp/errwrap v1.1.0 // indirect - github.com/hashicorp/go-multierror v1.1.1 // indirect github.com/huandu/xstrings v1.5.0 // indirect + github.com/ianlancetaylor/demangle v0.0.0-20240805132620-81f5be970eca // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jmoiron/sqlx v1.4.0 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect - github.com/klauspost/compress v1.18.0 // indirect github.com/kylelemons/godebug v1.1.0 // indirect github.com/lann/builder v0.0.0-20180802200727-47ae307949d0 // indirect github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0 // indirect @@ -112,7 +111,6 @@ require ( github.com/opencontainers/go-digest v1.0.0 // indirect github.com/opencontainers/image-spec v1.1.1 // indirect github.com/peterbourgon/diskv v2.0.1+incompatible // indirect - github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/prometheus/client_golang v1.23.2 // indirect github.com/prometheus/client_model v0.6.2 // indirect @@ -123,9 +121,10 @@ require ( github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/santhosh-tekuri/jsonschema/v6 v6.0.2 // indirect github.com/shopspring/decimal v1.4.0 // indirect - github.com/sirupsen/logrus v1.9.3 // indirect github.com/spf13/cast v1.7.0 // indirect github.com/stoewer/go-strcase v1.3.1 // indirect + github.com/tetratelabs/wabin v0.0.0-20230304001439-f6f874872834 // indirect + github.com/tetratelabs/wazero v1.9.0 // indirect github.com/x448/float16 v0.8.4 // indirect github.com/xlab/treeprint v1.2.0 // indirect go.etcd.io/etcd/api/v3 v3.6.5 // indirect diff --git a/go.sum b/go.sum index 2674c612..1c64dfc4 100644 --- a/go.sum +++ b/go.sum @@ -24,6 +24,8 @@ github.com/Masterminds/sprig/v3 v3.3.0 h1:mQh0Yrg1XPo6vjYXgtf5OtijNAKJRNcTdOOGZe github.com/Masterminds/sprig/v3 v3.3.0/go.mod h1:Zy1iXRYNqNLUolqCpL4uhk6SHUMAOSCzdgBfDb35Lz0= github.com/Masterminds/squirrel v1.5.4 h1:uUcX/aBc8O7Fg9kaISIUsHXdKuqehiXAMQTYX8afzqM= github.com/Masterminds/squirrel v1.5.4/go.mod h1:NNaOrjSoIDfDA40n7sr2tPNZRfjzjA400rg+riTZj10= +github.com/ProtonMail/go-crypto v1.3.0 h1:ILq8+Sf5If5DCpHQp4PbZdS1J7HDFRXz/+xKBiRGFrw= +github.com/ProtonMail/go-crypto v1.3.0/go.mod h1:9whxjD8Rbs29b4XWbB8irEcE8KHMqaR2e7GWU1R+/PE= github.com/alexbrainman/sspi v0.0.0-20250919150558-7d374ff0d59e h1:4dAU9FXIyQktpoUAgOJK3OTFc/xug0PCXYCqU0FgDKI= github.com/alexbrainman/sspi v0.0.0-20250919150558-7d374ff0d59e/go.mod h1:cEWa1LVoE5KvSD9ONXsZrj0z6KqySlCCNKHlLzbqAt4= github.com/antlr4-go/antlr/v4 v4.13.1 h1:SqQKkuVZ+zWkMMNkjy5FZe5mr5WURWnlpmOuzYWrPrQ= @@ -46,14 +48,8 @@ github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UF github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/chai2010/gettext-go v1.0.2 h1:1Lwwip6Q2QGsAdl/ZKPCwTe9fe0CjlUbqj5bFNSjIRk= github.com/chai2010/gettext-go v1.0.2/go.mod h1:y+wnP2cHYaVj19NZhYKAwEMH2CI1gNHeQQ+5AjwawxA= -github.com/containerd/containerd v1.7.29 h1:90fWABQsaN9mJhGkoVnuzEY+o1XDPbg9BTC9QTAHnuE= -github.com/containerd/containerd v1.7.29/go.mod h1:azUkWcOvHrWvaiUjSQH0fjzuHIwSPg1WL5PshGP4Szs= -github.com/containerd/errdefs v0.3.0 h1:FSZgGOeK4yuT/+DnF07/Olde/q4KBoMsaamhXxIMDp4= -github.com/containerd/errdefs v0.3.0/go.mod h1:+YBYIdtsnF4Iw6nWZhJcqGSg/dwvV7tyJ/kCkyJ2k+M= -github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I= -github.com/containerd/log v0.1.0/go.mod h1:VRRf09a7mHDIRezVKTRCrOq78v577GXq3bSa3EhrzVo= -github.com/containerd/platforms v0.2.1 h1:zvwtM3rz2YHPQsF2CHYM8+KtB5dvhISiXh5ZpSBQv6A= -github.com/containerd/platforms v0.2.1/go.mod h1:XHCb+2/hzowdiut9rkudds9bE5yJ7npe7dG/wG+uFPw= +github.com/cloudflare/circl v1.6.1 h1:zqIqSPIndyBh1bjLVVDHMPpVKqp8Su/V+6MeDzzQBQ0= +github.com/cloudflare/circl v1.6.1/go.mod h1:uddAzsPgqdMAYatqJ0lsjX1oECcQLIlRpzZh3pJrofs= github.com/coreos/go-semver v0.3.1 h1:yi21YpKnrx1gt5R+la8n5WgS0kCrsPp33dmEyHReZr4= github.com/coreos/go-semver v0.3.1/go.mod h1:irMmmIw/7yzSRPWryHsK7EYSg09caPQL03VsM8rvUec= github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8iXXhfZs= @@ -83,6 +79,8 @@ github.com/docker/go-metrics v0.0.1 h1:AgB/0SvBxihN0X8OR4SjsblXkbMvalQ8cjmtKQ2rQ github.com/docker/go-metrics v0.0.1/go.mod h1:cG1hvH2utMXtqgqqYE9plW6lDxS3/5ayHzueweSI3Vw= github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= +github.com/dylibso/observe-sdk/go v0.0.0-20240819160327-2d926c5d788a h1:UwSIFv5g5lIvbGgtf3tVwC7Ky9rmMFBp0RMs+6f6YqE= +github.com/dylibso/observe-sdk/go v0.0.0-20240819160327-2d926c5d788a/go.mod h1:C8DzXehI4zAbrdlbtOByKX6pfivJTBiV9Jjqv56Yd9Q= github.com/emicklei/go-restful/v3 v3.13.0 h1:C4Bl2xDndpU6nJ4bc1jXd+uTmYPVUwkD6bFY/oTyCes= github.com/emicklei/go-restful/v3 v3.13.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/evanphx/json-patch v5.9.11+incompatible h1:ixHHqfcGvxhWkniF1tWxBHA0yb4Z+d1UQi45df52xW8= @@ -91,12 +89,16 @@ github.com/evanphx/json-patch/v5 v5.9.11 h1:/8HVnzMq13/3x9TPvjG08wUGqBTmZBsCWzjT github.com/evanphx/json-patch/v5 v5.9.11/go.mod h1:3j+LviiESTElxA4p3EMKAB9HXj3/XEtnUf6OZxqIQTM= github.com/exponent-io/jsonpath v0.0.0-20210407135951-1de76d718b3f h1:Wl78ApPPB2Wvf/TIe2xdyJxTlb6obmF18d8QdkxNDu4= github.com/exponent-io/jsonpath v0.0.0-20210407135951-1de76d718b3f/go.mod h1:OSYXu++VVOHnXeitef/D8n/6y4QV8uLHSFXX4NeXMGc= +github.com/extism/go-sdk v1.7.1 h1:lWJos6uY+tRFdlIHR+SJjwFDApY7OypS/2nMhiVQ9Sw= +github.com/extism/go-sdk v1.7.1/go.mod h1:IT+Xdg5AZM9hVtpFUA+uZCJMge/hbvshl8bwzLtFyKA= github.com/fatih/camelcase v1.0.0 h1:hxNvNX/xYBp0ovncs8WyWZrOrpBNub/JfaMvbURyft8= github.com/fatih/camelcase v1.0.0/go.mod h1:yN2Sb0lFhZJUdVvtELVWefmrXpuZESvPmqwoZc+/fpc= 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/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= +github.com/fluxcd/cli-utils v0.36.0-flux.14 h1:I//AMVUXTc+M04UtIXArMXQZCazGMwfemodV1j/yG8c= +github.com/fluxcd/cli-utils v0.36.0-flux.14/go.mod h1:uDo7BYOfbdmk/asnHuI0IQPl6u0FCgcN54AHDu3Y5As= github.com/foxcpp/go-mockdns v1.1.0 h1:jI0rD8M0wuYAxL7r/ynTrCQQq0BVqfB99Vgk7DlmewI= github.com/foxcpp/go-mockdns v1.1.0/go.mod h1:IhLeSFGed3mJIAXPH2aiRQB+kqz7oqu8ld2qVbOu7Wk= github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= @@ -152,8 +154,8 @@ github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX 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-20250403155104-27863c87afa6 h1:BHT72Gu3keYf3ZEu2J0b1vyeLSOYI8bm5wbJM/8yDe8= -github.com/google/pprof v0.0.0-20250403155104-27863c87afa6/go.mod h1:boTsfXsheKC2y+lKOCMpSfarhxDeIzfZG1jqGcPl3cA= +github.com/google/pprof v0.0.0-20250630185457-6e76a2b096b5 h1:xhMrHhTJ6zxu3gA4enFM9MLn9AY7613teCdFnlUVbSQ= +github.com/google/pprof v0.0.0-20250630185457-6e76a2b096b5/go.mod h1:5hDyRhoBCxViHszMt12TnOpEI4VVi+U8Gm9iphldiMA= 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/gorilla/handlers v1.5.2 h1:cLTUSsNkgcwhgRqvCNmdbRWG0A3N4F+M2nWKdScwyEE= @@ -166,7 +168,6 @@ github.com/gosuri/uitable v0.0.4 h1:IG2xLKRvErL3uhY6e1BylFzG+aJiwQviDDTfOKeKTpY= github.com/gosuri/uitable v0.0.4/go.mod h1:tKR86bXuXPZazfOTG1FIzvjIdXzd0mo4Vtn16vt0PJo= github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79 h1:+ngKgrYPPJrOjhax5N+uePQ0Fh1Z7PheYoUI/0nzkPA= github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= -github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 h1:+9834+KizmvFV7pXQGSXQTsaWhq2GjuNUt0aUU0YBYw= github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus v1.0.1 h1:qnpSQwGEnkcRpTqNOIR6bJbR0gAorgP9CSALpRcKoAA= github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus v1.0.1/go.mod h1:lXGCsh6c22WGtjr+qGHj1otzZpV/1kwTMAqkwZsnWRU= github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.3.0 h1:FbSCl+KggFl+Ocym490i/EyXF4lPgLoUtcSWquBM0Rs= @@ -175,11 +176,6 @@ github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 h1:Ovs26xHkKqVztRpIrF/92Bcuy github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.1 h1:X5VWvz21y3gzm9Nw/kaUeku/1+uBhcekkmy4IkffJww= github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.1/go.mod h1:Zanoh4+gvIgluNqcfMVTJueD4wSS5hT7zTt4Mrutd90= -github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= -github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= -github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= -github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= -github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8= github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/golang-lru/arc/v2 v2.0.5 h1:l2zaLDubNhW4XO3LnliVj0GXO3+/CGNJAg1dcN2Fpfw= @@ -188,6 +184,8 @@ github.com/hashicorp/golang-lru/v2 v2.0.5 h1:wW7h1TG88eUIJ2i69gaE3uNVtEPIagzhGvH github.com/hashicorp/golang-lru/v2 v2.0.5/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= github.com/huandu/xstrings v1.5.0 h1:2ag3IFq9ZDANvthTwTiqSSZLjDc+BedvHPAp5tJy2TI= github.com/huandu/xstrings v1.5.0/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= +github.com/ianlancetaylor/demangle v0.0.0-20240805132620-81f5be970eca h1:T54Ema1DU8ngI+aef9ZhAhNGQhcRTrWxVeG07F+c/Rw= +github.com/ianlancetaylor/demangle v0.0.0-20240805132620-81f5be970eca/go.mod h1:gx7rwoVhcfuVKG5uya9Hs3Sxj7EIvldVofAWIUtGouw= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/jcmturner/aescts/v2 v2.0.0 h1:9YKLH6ey7H4eDBXW8khjYslgyqG2xZikXP0EQFKrle8= @@ -274,10 +272,6 @@ github.com/opencontainers/image-spec v1.1.1 h1:y0fUlFfIZhPF1W537XOLg0/fcx6zcHCJw github.com/opencontainers/image-spec v1.1.1/go.mod h1:qpqAh3Dmcf36wStyyWU+kCeDgrGnAve2nCC8+7h8Q0M= github.com/peterbourgon/diskv v2.0.1+incompatible h1:UBdAOUP5p4RWqPBg048CAvpKN+vxiaj6gdUUzhl4XmI= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= -github.com/phayes/freeport v0.0.0-20220201140144-74d24b5ae9f5 h1:Ii+DKncOVM8Cu1Hc+ETb5K+23HdAMvESYE3ZJ5b5cMI= -github.com/phayes/freeport v0.0.0-20220201140144-74d24b5ae9f5/go.mod h1:iIss55rKnNBTvrwdmkUpLnDpZoAHvWaiq5+iMmen4AE= -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= @@ -339,6 +333,10 @@ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= +github.com/tetratelabs/wabin v0.0.0-20230304001439-f6f874872834 h1:ZF+QBjOI+tILZjBaFj3HgFonKXUcwgJ4djLb6i42S3Q= +github.com/tetratelabs/wabin v0.0.0-20230304001439-f6f874872834/go.mod h1:m9ymHTgNSEjuxvw8E7WWe4Pl4hZQHXONY8wE6dMLaRk= +github.com/tetratelabs/wazero v1.9.0 h1:IcZ56OuxrtaEz8UYNRHBrUa9bYeX9oVY93KspZZBf/I= +github.com/tetratelabs/wazero v1.9.0/go.mod h1:TSbcXCfFP0L2FGkRPxHphadXPjo1T6W+CseNNY7EkjM= github.com/tmc/grpc-websocket-proxy v0.0.0-20220101234140-673ab2c3ae75 h1:6fotK7otjonDflCTK0BCfls4SPy3NcCVb5dqqmbRknE= github.com/tmc/grpc-websocket-proxy v0.0.0-20220101234140-673ab2c3ae75/go.mod h1:KO6IkyS8Y3j8OdNO85qEYBsRPuteD+YciPomcXdrMnk= github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= @@ -449,7 +447,6 @@ golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.39.0 h1:CvCKL8MeisomCi6qNZ+wbb0DN9E5AATixKsvNtMoMFk= @@ -500,8 +497,8 @@ 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= -helm.sh/helm/v3 v3.19.4 h1:E2yFBejmZBczWr5LblhjZbvAOAwVumfBO1AtN3nqI30= -helm.sh/helm/v3 v3.19.4/go.mod h1:PC1rk7PqacpkV4acUFMLStOOis7QM9Jq3DveHBInu4s= +helm.sh/helm/v4 v4.0.4 h1:5Lokr7XxCe6IW/NMtdECuAFW/0bTs/2831deUrlKqP8= +helm.sh/helm/v4 v4.0.4/go.mod h1:fMyG9onvVK6HOBjjkzhhHORAsgEWlRMqDY84lvX7GvY= k8s.io/api v0.35.0 h1:iBAU5LTyBI9vw3L5glmat1njFK34srdLmktWwLTprlY= k8s.io/api v0.35.0/go.mod h1:AQ0SNTzm4ZAczM03QH42c7l3bih1TbAXYo0DkF8ktnA= k8s.io/apiextensions-apiserver v0.35.0 h1:3xHk2rTOdWXXJM+RDQZJvdx0yEOgC0FgQ1PlJatA5T4= diff --git a/pkg/install/helm/applycrd.go b/pkg/install/helm/applycrd.go index 95a9a860..e5a65773 100644 --- a/pkg/install/helm/applycrd.go +++ b/pkg/install/helm/applycrd.go @@ -20,7 +20,8 @@ import ( "time" logf "github.com/cert-manager/cert-manager/pkg/logs" - "helm.sh/helm/v3/pkg/action" + "helm.sh/helm/v4/pkg/action" + "helm.sh/helm/v4/pkg/kube" "k8s.io/cli-runtime/pkg/resource" ) @@ -47,7 +48,11 @@ func CreateCRDs(allCRDs []*resource.Info, cfg *action.Configuration) error { discoveryClient.Invalidate() // Give time for the CRD to be recognized. - if err := cfg.KubeClient.Wait(createdCRDs, 60*time.Second); err != nil { + waiter, err := cfg.KubeClient.GetWaiter(kube.StatusWatcherStrategy) + if err != nil { + return err + } + if err := waiter.Wait(createdCRDs, 60*time.Second); err != nil { return err } diff --git a/pkg/install/helm/resource.go b/pkg/install/helm/resource.go index 324b2554..197c787c 100644 --- a/pkg/install/helm/resource.go +++ b/pkg/install/helm/resource.go @@ -20,7 +20,7 @@ import ( "bytes" "fmt" - "helm.sh/helm/v3/pkg/kube" + "helm.sh/helm/v4/pkg/kube" apierrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/cli-runtime/pkg/resource" ) diff --git a/pkg/install/helm/settings.go b/pkg/install/helm/settings.go index 855d7c30..ef6889e3 100644 --- a/pkg/install/helm/settings.go +++ b/pkg/install/helm/settings.go @@ -18,15 +18,14 @@ package helm import ( "context" - "fmt" "os" logf "github.com/cert-manager/cert-manager/pkg/logs" "github.com/go-logr/logr" "github.com/spf13/cobra" "github.com/spf13/pflag" - "helm.sh/helm/v3/pkg/action" - "helm.sh/helm/v3/pkg/cli" + "helm.sh/helm/v4/pkg/action" + "helm.sh/helm/v4/pkg/cli" "github.com/cert-manager/cmctl/v2/pkg/factory" ) @@ -35,7 +34,6 @@ const defaultCertManagerNamespace = "cert-manager" const debugLogLevel = 3 type NormalisedEnvSettings struct { - logger logr.Logger EnvSettings *cli.EnvSettings ActionConfiguration *action.Configuration Factory *factory.Factory @@ -52,10 +50,12 @@ func (n *NormalisedEnvSettings) Namespace() string { } func (n *NormalisedEnvSettings) Setup(ctx context.Context, cmd *cobra.Command) { - log := logf.FromContext(ctx) - n.logger = log + n.ActionConfiguration.SetLogger( + logr.ToSlogHandler(logf.FromContext(ctx)), + ) n.Factory = factory.New(cmd) + // nolint:contextcheck // False positive n.setupEnvSettings(cmd) { @@ -99,7 +99,7 @@ func (n *NormalisedEnvSettings) setupEnvSettings(cmd *cobra.Command) { // >= 3. existingPreRunE := cmd.PreRunE cmd.PreRunE = func(cmd *cobra.Command, args []string) error { - if n.logger.V(debugLogLevel).Enabled() { + if n.ActionConfiguration.Logger().Enabled(cmd.Context(), debugLogLevel) { n.EnvSettings.Debug = true } @@ -116,8 +116,5 @@ func (n *NormalisedEnvSettings) InitActionConfiguration() error { n.Factory.RESTClientGetter, n.Factory.Namespace, os.Getenv("HELM_DRIVER"), - func(format string, v ...any) { - n.logger.Info(fmt.Sprintf(format, v...)) - }, ) } diff --git a/pkg/install/install.go b/pkg/install/install.go index c44caae5..04c48ffd 100644 --- a/pkg/install/install.go +++ b/pkg/install/install.go @@ -18,6 +18,7 @@ package install import ( "context" + "errors" "fmt" "io" "strings" @@ -25,13 +26,14 @@ import ( logf "github.com/cert-manager/cert-manager/pkg/logs" "github.com/spf13/cobra" - "helm.sh/helm/v3/pkg/action" - "helm.sh/helm/v3/pkg/chart" - "helm.sh/helm/v3/pkg/chart/loader" - "helm.sh/helm/v3/pkg/chartutil" - "helm.sh/helm/v3/pkg/cli/values" - "helm.sh/helm/v3/pkg/getter" - "helm.sh/helm/v3/pkg/release" + "helm.sh/helm/v4/pkg/action" + "helm.sh/helm/v4/pkg/chart" + "helm.sh/helm/v4/pkg/chart/common" + "helm.sh/helm/v4/pkg/chart/loader" + "helm.sh/helm/v4/pkg/cli/values" + "helm.sh/helm/v4/pkg/getter" + "helm.sh/helm/v4/pkg/kube" + "helm.sh/helm/v4/pkg/release" "k8s.io/cli-runtime/pkg/genericclioptions" "github.com/cert-manager/cmctl/v2/pkg/build" @@ -98,13 +100,17 @@ func NewCmdInstall(setupCtx context.Context, ioStreams genericclioptions.IOStrea if err != nil { return err } + rac, err := release.NewAccessor(rel) + if err != nil { + return err + } if options.DryRun { - fmt.Fprintf(ioStreams.Out, "%s", rel.Manifest) + fmt.Fprintf(ioStreams.Out, "%s", rac.Manifest()) return nil } - printReleaseSummary(ioStreams.Out, rel) + printReleaseSummary(ioStreams.Out, rac) return nil }, } @@ -145,7 +151,7 @@ func NewCmdInstall(setupCtx context.Context, ioStreams genericclioptions.IOStrea // wait for those to be "Ready". // This creates a Helm "release" artifact in a Secret in the target namespace, which contains // a record of all the resources installed by Helm (except the CRDs). -func (o *InstallOptions) runInstall(ctx context.Context) (*release.Release, error) { +func (o *InstallOptions) runInstall(ctx context.Context) (release.Releaser, error) { log := logf.FromContext(ctx, "install") // Find chart @@ -154,18 +160,22 @@ func (o *InstallOptions) runInstall(ctx context.Context) (*release.Release, erro return nil, err } - chart, err := loader.Load(cp) + chrt, err := loader.Load(cp) + if err != nil { + return nil, err + } + cac, err := chart.NewAccessor(chrt) if err != nil { return nil, err } // Check if chart is installable - if err := checkIfInstallable(chart); err != nil { + if err := checkIfInstallable(cac); err != nil { return nil, err } // Console print if chart is deprecated - if chart.Metadata.Deprecated { + if cac.Deprecated() { log.Error(fmt.Errorf("chart.Metadata.Deprecated is true"), "This chart is deprecated") } @@ -177,22 +187,20 @@ func (o *InstallOptions) runInstall(ctx context.Context) (*release.Release, erro } // Dryrun template generation (used for rendering the CRDs in /templates) - o.client.DryRun = true // Do not apply install - o.client.ClientOnly = true // Do not validate against cluster (otherwise double CRDs can cause error) + o.client.DryRunStrategy = action.DryRunClient // Do not validate against cluster (otherwise double CRDs can cause error) // Kube version to be used in dry run template generation which does not // talk to kube apiserver. This is to ensure that template generation // does not fail because our Kubernetes minimum version requirement is // higher than that hardcoded in Helm codebase for client-only runs - o.client.KubeVersion = &chartutil.KubeVersion{ + o.client.KubeVersion = &common.KubeVersion{ Version: "v999.999.999", Major: "999", Minor: "999", } chartValues[installCRDsFlagName] = true // Make sure to render CRDs - dryRunResult, err := o.client.Run(chart, chartValues) + dryRunResult, err := o.client.Run(chrt, chartValues) if err != nil { return nil, err - } if o.DryRun { @@ -204,9 +212,13 @@ func (o *InstallOptions) runInstall(ctx context.Context) (*release.Release, erro if err := o.settings.InitActionConfiguration(); err != nil { return nil, err } + rac, err := release.NewAccessor(dryRunResult) + if err != nil { + return nil, err + } // Extract the resource.Info objects from the manifest - resources, err := helm.ParseMultiDocumentYAML(dryRunResult.Manifest, o.settings.ActionConfiguration.KubeClient) + resources, err := helm.ParseMultiDocumentYAML(rac.Manifest(), o.settings.ActionConfiguration.KubeClient) if err != nil { return nil, err } @@ -235,46 +247,49 @@ func (o *InstallOptions) runInstall(ctx context.Context) (*release.Release, erro } // Install chart - o.client.DryRun = false // Apply DryRun cli flags - o.client.ClientOnly = false // Perform install against cluster + o.client.DryRunStrategy = action.DryRunNone // Perform install against cluster o.client.KubeVersion = nil - o.client.Wait = o.Wait // Wait for resources to be ready - // If part of the install fails and the Atomic option is set to True, - // all resource installs are reverted. Atomic cannot be enabled without - // waiting (if Atomic=True is set, the value for Wait is overwritten with True), - // so only enable Atomic if we are waiting. - o.client.Atomic = o.Wait - // The cert-manager chart currently has only a startupapicheck hook, - // if waiting is disabled, this hook should be disabled too; otherwise - // the hook will still wait for the installation to succeed. - o.client.DisableHooks = !o.Wait + if o.Wait { + o.client.WaitStrategy = kube.StatusWatcherStrategy // Wait for resources to be ready + // If part of the installation fails and the RollbackOnFailure option is set to True, + // all resource installs are reverted. RollbackOnFailure cannot be enabled without + // waiting, so only enable RollbackOnFailure if we are waiting. + o.client.RollbackOnFailure = true + } else { + o.client.WaitStrategy = kube.HookOnlyStrategy + // The cert-manager chart currently has only a startupapicheck hook, + // if waiting is disabled, this hook should be disabled too; otherwise + // the hook will still wait for the installation to succeed. + o.client.DisableHooks = true + } chartValues[installCRDsFlagName] = false // Do not render CRDs, as this might cause problems when uninstalling using helm - return o.client.Run(chart, chartValues) + return o.client.Run(chrt, chartValues) } -func printReleaseSummary(out io.Writer, rel *release.Release) { - fmt.Fprintf(out, "NAME: %s\n", rel.Name) - if !rel.Info.LastDeployed.IsZero() { - fmt.Fprintf(out, "LAST DEPLOYED: %s\n", rel.Info.LastDeployed.Format(time.ANSIC)) +func printReleaseSummary(out io.Writer, rac release.Accessor) { + fmt.Fprintf(out, "NAME: %s\n", rac.Name()) + if !rac.DeployedAt().IsZero() { + fmt.Fprintf(out, "LAST DEPLOYED: %s\n", rac.DeployedAt().Format(time.ANSIC)) } - fmt.Fprintf(out, "NAMESPACE: %s\n", rel.Namespace) - fmt.Fprintf(out, "STATUS: %s\n", rel.Info.Status.String()) - fmt.Fprintf(out, "REVISION: %d\n", rel.Version) - fmt.Fprintf(out, "DESCRIPTION: %s\n", rel.Info.Description) - - if len(rel.Info.Notes) > 0 { - fmt.Fprintf(out, "NOTES:\n%s\n", strings.TrimSpace(rel.Info.Notes)) + fmt.Fprintf(out, "NAMESPACE: %s\n", rac.Namespace()) + fmt.Fprintf(out, "STATUS: %s\n", rac.Status()) + fmt.Fprintf(out, "REVISION: %d\n", rac.Version()) + // Helm v4's release.Accessor does not expose a description field, + // so we intentionally omit the DESCRIPTION line that was present in + // earlier Helm versions to avoid printing an empty value. + + if len(rac.Notes()) > 0 { + fmt.Fprintf(out, "NOTES:\n%s\n", strings.TrimSpace(rac.Notes())) } } -// Only Application chart type are installable. -func checkIfInstallable(ch *chart.Chart) error { - switch ch.Metadata.Type { - case "", "application": - return nil +// Only Application chart types are installable. +func checkIfInstallable(cac chart.Accessor) error { + if cac.IsLibraryChart() { + return errors.New("library charts are not installable") } - return fmt.Errorf("%s charts are not installable", ch.Metadata.Type) + return nil } diff --git a/pkg/install/util.go b/pkg/install/util.go index 957db5cc..61f444f8 100644 --- a/pkg/install/util.go +++ b/pkg/install/util.go @@ -21,8 +21,8 @@ import ( "path/filepath" "github.com/spf13/pflag" - "helm.sh/helm/v3/pkg/action" - "helm.sh/helm/v3/pkg/cli/values" + "helm.sh/helm/v4/pkg/action" + "helm.sh/helm/v4/pkg/cli/values" "k8s.io/client-go/util/homedir" ) diff --git a/pkg/uninstall/uninstall.go b/pkg/uninstall/uninstall.go index 14aae8a7..caf01016 100644 --- a/pkg/uninstall/uninstall.go +++ b/pkg/uninstall/uninstall.go @@ -26,11 +26,14 @@ import ( "strings" "github.com/spf13/cobra" - "helm.sh/helm/v3/pkg/action" - "helm.sh/helm/v3/pkg/chartutil" - "helm.sh/helm/v3/pkg/release" - "helm.sh/helm/v3/pkg/releaseutil" - "helm.sh/helm/v3/pkg/storage/driver" + "helm.sh/helm/v4/pkg/action" + chartutil "helm.sh/helm/v4/pkg/chart/v2/util" + "helm.sh/helm/v4/pkg/kube" + "helm.sh/helm/v4/pkg/release" + "helm.sh/helm/v4/pkg/release/common" + v1release "helm.sh/helm/v4/pkg/release/v1" + releaseutil "helm.sh/helm/v4/pkg/release/v1/util" + "helm.sh/helm/v4/pkg/storage/driver" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/cli-runtime/pkg/genericclioptions" "sigs.k8s.io/yaml" @@ -96,7 +99,15 @@ func NewCmd(setupCtx context.Context, ioStreams genericclioptions.IOStreams) *co } if options.dryRun { - fmt.Fprintf(ioStreams.Out, "%s", res.Release.Manifest) + if res.Release == nil { + return errors.New("res.Release must not be nil") + } + + rac, err := release.NewAccessor(res.Release) + if err != nil { + return err + } + fmt.Fprintf(ioStreams.Out, "%s", rac.Manifest()) return nil } @@ -125,10 +136,11 @@ func run(ctx context.Context, o options) (*release.UninstallReleaseResponse, err // The cert-manager Helm chart currently does not have any uninstall hooks. o.client.DisableHooks = false o.client.DryRun = o.dryRun - o.client.Wait = o.wait - if o.client.Wait { + if o.wait { + o.client.WaitStrategy = kube.StatusWatcherStrategy o.client.DeletionPropagation = "foreground" } else { + o.client.WaitStrategy = kube.HookOnlyStrategy // we don't have any uninstall hooks o.client.DeletionPropagation = "background" } o.client.KeepHistory = false @@ -163,8 +175,13 @@ func addCRDAnnotations(_ context.Context, o options) error { return fmt.Errorf("uninstall: %v", err) } - if lastRelease.Info.Status != release.StatusDeployed { - return fmt.Errorf("release %v is in a non-deployed state: %v", o.releaseName, lastRelease.Info.Status) + rac, err := release.NewAccessor(lastRelease) + if err != nil { + return err + } + + if rac.Status() != common.StatusDeployed.String() { + return fmt.Errorf("release %v is in a non-deployed state: %v", o.releaseName, rac.Status()) } const ( @@ -175,7 +192,7 @@ func addCRDAnnotations(_ context.Context, o options) error { // Check if the release manifest contains CRDs. If it does, we need to modify the // release manifest to add the "helm.sh/resource-policy: keep" annotation to the CRDs. - manifests := releaseutil.SplitManifests(lastRelease.Manifest) + manifests := releaseutil.SplitManifests(rac.Manifest()) foundNonAnnotatedCRD := false for key, manifest := range manifests { var entry releaseutil.SimpleHead @@ -228,12 +245,33 @@ func addCRDAnnotations(_ context.Context, o options) error { fullManifest.WriteString("\n---\n") } - lastRelease.Manifest = fullManifest.String() + lastRelease, err = setManifest(lastRelease, fullManifest.String()) + if err != nil { + return err + } if err := o.settings.ActionConfiguration.Releases.Update(lastRelease); err != nil { - o.settings.ActionConfiguration.Log("uninstall: Failed to store updated release: %s", err) + o.settings.ActionConfiguration.Logger().Error( + "uninstall: Failed to store updated release", + "err", err, + ) } } return nil } + +// similar to the code in Helm (https://github.com/helm/helm/blob/c3a0d3b86025d2a06e370b9f12bf1e593418b45a/pkg/action/uninstall.go#L102-L126) +// we first convert the releaser to a v1 release to be able to set the manifest +func setManifest(release release.Releaser, manifest string) (release.Releaser, error) { + switch r := release.(type) { + case v1release.Release: + r.Manifest = manifest + return r, nil + case *v1release.Release: + r.Manifest = manifest + return r, nil + default: + return nil, fmt.Errorf("unsupported release type: %T", release) + } +} diff --git a/test/integration/ctl_uninstall_test.go b/test/integration/ctl_uninstall_test.go index 4fb2c2c7..f57f088e 100644 --- a/test/integration/ctl_uninstall_test.go +++ b/test/integration/ctl_uninstall_test.go @@ -74,7 +74,7 @@ func TestCtlUninstall(t *testing.T) { inputArgs: []string{"x", "uninstall", "--wait=false"}, expErr: false, - expOutput: `These resources were kept due to the resource policy:`, + expOutput: `release "cert-manager" uninstalled`, didInstallCRDs: true, },