From cce4a284be69d0840feb999069f1c0e6f6b8ab3d Mon Sep 17 00:00:00 2001 From: Ali Abbas Jaffri Date: Sun, 29 Dec 2024 20:32:10 +0100 Subject: [PATCH 1/8] Update ingress.md (#21324) Fixing spell error Signed-off-by: Ali Abbas Jaffri --- docs/operator-manual/ingress.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/operator-manual/ingress.md b/docs/operator-manual/ingress.md index b3a477252feec..5037d77203695 100644 --- a/docs/operator-manual/ingress.md +++ b/docs/operator-manual/ingress.md @@ -408,7 +408,7 @@ spec: ## AWS Application Load Balancers (ALBs) And Classic ELB (HTTP Mode) AWS ALBs can be used as an L7 Load Balancer for both UI and gRPC traffic, whereas Classic ELBs and NLBs can be used as L4 Load Balancers for both. -When using an ALB, you'll want to create a second service for argocd-server. This is necessary because we need to tell the ALB to send the GRPC traffic to a different target group then the UI traffic, since the backend protocol is HTTP2 instead of HTTP1. +When using an ALB, you'll want to create a second service for argocd-server. This is necessary because we need to tell the ALB to send the GRPC traffic to a different target group than the UI traffic, since the backend protocol is HTTP2 instead of HTTP1. ```yaml apiVersion: v1 From dd366f56fa9fac94aeb04989a0164742d4e82c22 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 30 Dec 2024 03:53:41 +0000 Subject: [PATCH 2/8] chore(deps): bump github.com/go-git/go-git/v5 from 5.12.0 to 5.13.0 (#21329) Bumps [github.com/go-git/go-git/v5](https://github.com/go-git/go-git) from 5.12.0 to 5.13.0. - [Release notes](https://github.com/go-git/go-git/releases) - [Commits](https://github.com/go-git/go-git/compare/v5.12.0...v5.13.0) --- updated-dependencies: - dependency-name: github.com/go-git/go-git/v5 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 8 ++++---- go.sum | 31 ++++++++++++++----------------- 2 files changed, 18 insertions(+), 21 deletions(-) diff --git a/go.mod b/go.mod index 336a1b8018564..3d91d05850ec2 100644 --- a/go.mod +++ b/go.mod @@ -29,7 +29,7 @@ require ( github.com/felixge/httpsnoop v1.0.4 github.com/fsnotify/fsnotify v1.8.0 github.com/gfleury/go-bitbucket-v1 v0.0.0-20220301131131-8e7ed04b843e - github.com/go-git/go-git/v5 v5.12.0 + github.com/go-git/go-git/v5 v5.13.0 github.com/go-jose/go-jose/v3 v3.0.3 github.com/go-logr/logr v1.4.2 github.com/go-openapi/loads v0.22.0 @@ -176,7 +176,7 @@ require ( github.com/Masterminds/goutils v1.1.1 // indirect github.com/Microsoft/go-winio v0.6.1 // indirect github.com/PagerDuty/go-pagerduty v1.7.0 // indirect - github.com/ProtonMail/go-crypto v1.0.0 // indirect + github.com/ProtonMail/go-crypto v1.1.3 // indirect github.com/RocketChat/Rocket.Chat.Go.SDK v0.0.0-20210112200207-10ab4d695d60 // indirect github.com/alicebob/gopher-json v0.0.0-20230218143504-906a9b012302 // indirect github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect @@ -198,7 +198,7 @@ require ( github.com/ghodss/yaml v1.0.0 // indirect github.com/go-errors/errors v1.4.2 // indirect github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect - github.com/go-git/go-billy/v5 v5.5.0 // indirect + github.com/go-git/go-billy/v5 v5.6.0 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/go-openapi/analysis v0.23.0 // indirect github.com/go-openapi/errors v0.22.0 // indirect @@ -260,7 +260,7 @@ require ( github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 // indirect github.com/shopspring/decimal v1.4.0 // indirect - github.com/skeema/knownhosts v1.2.2 // indirect + github.com/skeema/knownhosts v1.3.0 // indirect github.com/slack-go/slack v0.12.2 // indirect github.com/spf13/cast v1.7.0 // indirect github.com/stretchr/objx v0.5.2 // indirect diff --git a/go.sum b/go.sum index 0154b544807b7..964a6a9053440 100644 --- a/go.sum +++ b/go.sum @@ -61,8 +61,8 @@ github.com/OvyFlash/telegram-bot-api/v5 v5.0.0-20240108230938-63e5c59035bf h1:a7 github.com/OvyFlash/telegram-bot-api/v5 v5.0.0-20240108230938-63e5c59035bf/go.mod h1:A2S0CWkNylc2phvKXWBBdD3K0iGnDBGbzRpISP2zBl8= github.com/PagerDuty/go-pagerduty v1.7.0 h1:S1NcMKECxT5hJwV4VT+QzeSsSiv4oWl1s2821dUqG/8= github.com/PagerDuty/go-pagerduty v1.7.0/go.mod h1:PuFyJKRz1liIAH4h5KVXVD18Obpp1ZXRdxHvmGXooro= -github.com/ProtonMail/go-crypto v1.0.0 h1:LRuvITjQWX+WIfr930YHG2HNfjR1uOfyf5vE0kC2U78= -github.com/ProtonMail/go-crypto v1.0.0/go.mod h1:EjAoLdwvbIOoOQr3ihjnSoLZRtE8azugULFRteWMNc0= +github.com/ProtonMail/go-crypto v1.1.3 h1:nRBOetoydLeUb4nHajyO2bKqMLfWQ/ZPwkXqXxPxCFk= +github.com/ProtonMail/go-crypto v1.1.3/go.mod h1:rA3QumHc/FZ8pAHreoekgiAbzpNsfQAosU5td4SnOrE= github.com/RocketChat/Rocket.Chat.Go.SDK v0.0.0-20210112200207-10ab4d695d60 h1:prBTRx78AQnXzivNT9Crhu564W/zPPr3ibSlpT9xKcE= github.com/RocketChat/Rocket.Chat.Go.SDK v0.0.0-20210112200207-10ab4d695d60/go.mod h1:rjP7sIipbZcagro/6TCk6X0ZeFT2eyudH5+fve/cbBA= github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= @@ -157,7 +157,6 @@ github.com/bsm/ginkgo/v2 v2.12.0 h1:Ny8MWAHyOepLGlLKYmXG4IEkioBysk6GpaRTLC8zwWs= github.com/bsm/ginkgo/v2 v2.12.0/go.mod h1:SwYbGRRDovPVboqFv0tPTcG1sN61LM1Z4ARdbAV9g4c= github.com/bsm/gomega v1.27.10 h1:yeMWxP2pV2fG3FgAODIY8EiRE3dy0aeFYt4l7wh6yKA= github.com/bsm/gomega v1.27.10/go.mod h1:JyEr/xRbxbtgWNi8tIEVPUYZ5Dzef52k01W3YH0H+O0= -github.com/bwesterb/go-ristretto v1.2.3/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= github.com/bwmarrin/discordgo v0.19.0/go.mod h1:O9S4p+ofTFwB02em7jkpkV8M3R0/PUVOwN61zSZ0r4Q= github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= github.com/casbin/casbin/v2 v2.102.0 h1:weq9iSThUSL21SH3VrwoKa2DgRsaYMfjRNX/yOU3Foo= @@ -189,7 +188,6 @@ github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMn github.com/chzyer/test v1.0.0/go.mod h1:2JlltgoNkt4TW/z9V/IzDdFaMTM2JPIi26O1pF38GC8= github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA= github.com/cloudflare/circl v1.3.7 h1:qlCDlTPz2n9fu58M0Nh1J/JzcFpfgkFHHX3O35r5vcU= github.com/cloudflare/circl v1.3.7/go.mod h1:sRTcRWXGLrKw6yIGJ+l7amYJFfAXbZG0kBSc8r4zxgA= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= @@ -235,8 +233,8 @@ github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5m github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= -github.com/elazarl/goproxy v0.0.0-20230808193330-2592e75ae04a h1:mATvB/9r/3gvcejNsXKSkQ6lcIaNec2nyfOdlTBR2lU= -github.com/elazarl/goproxy v0.0.0-20230808193330-2592e75ae04a/go.mod h1:Ro8st/ElPeALwNFlcTpWmkr6IoMFfkjXAvTHpevnDsM= +github.com/elazarl/goproxy v1.2.1 h1:njjgvO6cRG9rIqN2ebkqy6cQz2Njkx7Fsfv/zIZqgug= +github.com/elazarl/goproxy v1.2.1/go.mod h1:YfEbZtqP4AetfO6d40vWchF3znWX7C7Vd6ZMfdL8z64= github.com/emicklei/go-restful/v3 v3.8.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/emicklei/go-restful/v3 v3.11.0 h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxERmMY4rD+g= github.com/emicklei/go-restful/v3 v3.11.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= @@ -285,20 +283,20 @@ github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= github.com/gin-gonic/gin v1.6.3 h1:ahKqKTFpO5KTPHxWZjEdPScmYaGtLo8Y4DMHoEsnp14= github.com/gin-gonic/gin v1.6.3/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M= -github.com/gliderlabs/ssh v0.3.7 h1:iV3Bqi942d9huXnzEF2Mt+CY9gLu8DNM4Obd+8bODRE= -github.com/gliderlabs/ssh v0.3.7/go.mod h1:zpHEXBstFnQYtGnB8k8kQLol82umzn/2/snG7alWVD8= +github.com/gliderlabs/ssh v0.3.8 h1:a4YXD1V7xMF9g5nTkdfnja3Sxy1PVDCj1Zg4Wb8vY6c= +github.com/gliderlabs/ssh v0.3.8/go.mod h1:xYoytBv1sV0aL3CavoDuJIQNURXkkfPA/wxQ1pL1fAU= github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og= github.com/go-fed/httpsig v1.1.0 h1:9M+hb0jkEICD8/cAiNqEB66R87tTINszBRTjwjQzWcI= github.com/go-fed/httpsig v1.1.0/go.mod h1:RCMrTZvN1bJYtofsG4rd5NaO5obxQ5xBkdiS7xsT7bM= github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 h1:+zs/tPmkDkHx3U66DAb0lQFJrpS6731Oaa12ikc+DiI= github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376/go.mod h1:an3vInlBmSxCcxctByoQdvwPiA7DTK7jaaFDBTtu0ic= -github.com/go-git/go-billy/v5 v5.5.0 h1:yEY4yhzCDuMGSv83oGxiBotRzhwhNr8VZyphhiu+mTU= -github.com/go-git/go-billy/v5 v5.5.0/go.mod h1:hmexnoNsr2SJU1Ju67OaNz5ASJY3+sHgFRpCtpDCKow= +github.com/go-git/go-billy/v5 v5.6.0 h1:w2hPNtoehvJIxR00Vb4xX94qHQi/ApZfX+nBE2Cjio8= +github.com/go-git/go-billy/v5 v5.6.0/go.mod h1:sFDq7xD3fn3E0GOwUSZqHo9lrkmx8xJhA0ZrfvjBRGM= github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399 h1:eMje31YglSBqCdIqdhKBW8lokaMrL3uTkpGYlE2OOT4= github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399/go.mod h1:1OCfN199q1Jm3HZlxleg+Dw/mwps2Wbk9frAWm+4FII= -github.com/go-git/go-git/v5 v5.12.0 h1:7Md+ndsjrzZxbddRDZjF14qK+NN56sy6wkqaVrjZtys= -github.com/go-git/go-git/v5 v5.12.0/go.mod h1:FTM9VKtnI2m65hNI/TenDDDnUf2Q9FHnXYjuz9i5OEY= +github.com/go-git/go-git/v5 v5.13.0 h1:vLn5wlGIh/X78El6r3Jr+30W16Blk0CTcxTYcYPWi5E= +github.com/go-git/go-git/v5 v5.13.0/go.mod h1:Wjo7/JyVKtQgUNdXYXIepzWfJQkUEIGvkvVkiXRR/zw= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-jose/go-jose/v3 v3.0.3 h1:fFKWeig/irsp7XD2zBxvnmA/XaRWp5V3CBsZXJF7G7k= github.com/go-jose/go-jose/v3 v3.0.3/go.mod h1:5b+7YgP7ZICgJDBdfjZaIt+H/9L9T/YQrVfLAMboGkQ= @@ -766,8 +764,9 @@ github.com/onsi/gomega v1.27.8/go.mod h1:2J8vzI/s+2shY9XHRApDkdgPo1TKT7P2u6fXeJK github.com/onsi/gomega v1.27.10/go.mod h1:RsS8tutOdbdgzbPtzzATp12yT7kM5I5aElG3evPbQ0M= github.com/onsi/gomega v1.30.0/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ= github.com/onsi/gomega v1.33.0/go.mod h1:+925n5YtiFsLzzafLUHzVMBpvvRAzrydIBiSIxjX3wY= -github.com/onsi/gomega v1.33.1 h1:dsYjIxxSR755MDmKVsaFQTE22ChNBcuuTWgkUDSubOk= github.com/onsi/gomega v1.33.1/go.mod h1:U4R44UsT+9eLIaYRB2a5qajjtQYn0hauxvRm16AVYg0= +github.com/onsi/gomega v1.34.1 h1:EUMJIKUjM8sKjYbtxQI9A4z2o+rruxnzNvpknOXie6k= +github.com/onsi/gomega v1.34.1/go.mod h1:kU1QgUvBDLXBJq618Xvm2LUX6rSAfRaFRTcdOeDLwwY= github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= @@ -884,8 +883,8 @@ github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic github.com/sirupsen/logrus v1.9.2/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= -github.com/skeema/knownhosts v1.2.2 h1:Iug2P4fLmDw9f41PB6thxUkNUkJzB5i+1/exaj40L3A= -github.com/skeema/knownhosts v1.2.2/go.mod h1:xYbVRSPxqBZFrdmDyMmsOs+uX1UZC3nTN3ThzgDxUwo= +github.com/skeema/knownhosts v1.3.0 h1:AM+y0rI04VksttfwjkSTNQorvGqmwATnvnAHpSgc0LY= +github.com/skeema/knownhosts v1.3.0/go.mod h1:sPINvnADmT/qYH1kfv+ePMmOBTH6Tbl7b5LvTDjFK7M= github.com/skratchdot/open-golang v0.0.0-20160302144031-75fb7ed4208c h1:fyKiXKO1/I/B6Y2U8T7WdQGWzwehOuGIrljPtt7YTTI= github.com/skratchdot/open-golang v0.0.0-20160302144031-75fb7ed4208c/go.mod h1:sUM3LWHvSMaG192sy56D9F7CNvL7jUJVXoqM1QKLnog= github.com/slack-go/slack v0.12.2 h1:x3OppyMyGIbbiyFhsBmpf9pwkUzMhthJMRNmNlA4LaQ= @@ -1035,9 +1034,7 @@ golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= -golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= -golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0= golang.org/x/crypto v0.10.0/go.mod h1:o4eNf7Ede1fv+hwOwZsTHl9EsPFO6q6ZvYR8vYfY45I= golang.org/x/crypto v0.11.0/go.mod h1:xgJhtzW8F9jGdVFWZESrid1U1bjeNy4zgy5cRr/CIio= From 84f2ab850d714de17cea9dcb621146895d98eaa2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 30 Dec 2024 03:59:23 +0000 Subject: [PATCH 3/8] chore(deps): bump github.com/casbin/govaluate from 1.2.0 to 1.3.0 (#21331) Bumps [github.com/casbin/govaluate](https://github.com/casbin/govaluate) from 1.2.0 to 1.3.0. - [Release notes](https://github.com/casbin/govaluate/releases) - [Changelog](https://github.com/casbin/govaluate/blob/master/.releaserc.json) - [Commits](https://github.com/casbin/govaluate/compare/v1.2.0...v1.3.0) --- updated-dependencies: - dependency-name: github.com/casbin/govaluate dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index 3d91d05850ec2..7bd299ea6ba67 100644 --- a/go.mod +++ b/go.mod @@ -18,7 +18,7 @@ require ( github.com/bombsimon/logrusr/v2 v2.0.1 github.com/bradleyfalzon/ghinstallation/v2 v2.12.0 github.com/casbin/casbin/v2 v2.102.0 - github.com/casbin/govaluate v1.2.0 + github.com/casbin/govaluate v1.3.0 github.com/cespare/xxhash/v2 v2.3.0 github.com/chainguard-dev/git-urls v1.0.2 github.com/coreos/go-oidc/v3 v3.11.0 diff --git a/go.sum b/go.sum index 964a6a9053440..42e138863d35c 100644 --- a/go.sum +++ b/go.sum @@ -161,8 +161,9 @@ github.com/bwmarrin/discordgo v0.19.0/go.mod h1:O9S4p+ofTFwB02em7jkpkV8M3R0/PUVO github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= github.com/casbin/casbin/v2 v2.102.0 h1:weq9iSThUSL21SH3VrwoKa2DgRsaYMfjRNX/yOU3Foo= github.com/casbin/casbin/v2 v2.102.0/go.mod h1:LO7YPez4dX3LgoTCqSQAleQDo0S0BeZBDxYnPUl95Ng= -github.com/casbin/govaluate v1.2.0 h1:wXCXFmqyY+1RwiKfYo3jMKyrtZmOL3kHwaqDyCPOYak= github.com/casbin/govaluate v1.2.0/go.mod h1:G/UnbIjZk/0uMNaLwZZmFQrR72tYRZWQkO70si/iR7A= +github.com/casbin/govaluate v1.3.0 h1:VA0eSY0M2lA86dYd5kPPuNZMUD9QkWnOCnavGrw9myc= +github.com/casbin/govaluate v1.3.0/go.mod h1:G/UnbIjZk/0uMNaLwZZmFQrR72tYRZWQkO70si/iR7A= github.com/cenkalti/backoff v2.1.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= github.com/cenkalti/backoff/v4 v4.1.1/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= From 635e592778d1eeba74070f887aec974e5afde664 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 30 Dec 2024 04:42:07 +0000 Subject: [PATCH 4/8] chore(deps): bump github.com/casbin/casbin/v2 from 2.102.0 to 2.103.0 (#21330) Bumps [github.com/casbin/casbin/v2](https://github.com/casbin/casbin) from 2.102.0 to 2.103.0. - [Release notes](https://github.com/casbin/casbin/releases) - [Changelog](https://github.com/casbin/casbin/blob/master/.releaserc.json) - [Commits](https://github.com/casbin/casbin/compare/v2.102.0...v2.103.0) --- updated-dependencies: - dependency-name: github.com/casbin/casbin/v2 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index 7bd299ea6ba67..2a8a1b1d6bee8 100644 --- a/go.mod +++ b/go.mod @@ -17,7 +17,7 @@ require ( github.com/bmatcuk/doublestar/v4 v4.7.1 github.com/bombsimon/logrusr/v2 v2.0.1 github.com/bradleyfalzon/ghinstallation/v2 v2.12.0 - github.com/casbin/casbin/v2 v2.102.0 + github.com/casbin/casbin/v2 v2.103.0 github.com/casbin/govaluate v1.3.0 github.com/cespare/xxhash/v2 v2.3.0 github.com/chainguard-dev/git-urls v1.0.2 diff --git a/go.sum b/go.sum index 42e138863d35c..53fe0babfd7bd 100644 --- a/go.sum +++ b/go.sum @@ -159,9 +159,8 @@ github.com/bsm/gomega v1.27.10 h1:yeMWxP2pV2fG3FgAODIY8EiRE3dy0aeFYt4l7wh6yKA= github.com/bsm/gomega v1.27.10/go.mod h1:JyEr/xRbxbtgWNi8tIEVPUYZ5Dzef52k01W3YH0H+O0= github.com/bwmarrin/discordgo v0.19.0/go.mod h1:O9S4p+ofTFwB02em7jkpkV8M3R0/PUVOwN61zSZ0r4Q= github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= -github.com/casbin/casbin/v2 v2.102.0 h1:weq9iSThUSL21SH3VrwoKa2DgRsaYMfjRNX/yOU3Foo= -github.com/casbin/casbin/v2 v2.102.0/go.mod h1:LO7YPez4dX3LgoTCqSQAleQDo0S0BeZBDxYnPUl95Ng= -github.com/casbin/govaluate v1.2.0/go.mod h1:G/UnbIjZk/0uMNaLwZZmFQrR72tYRZWQkO70si/iR7A= +github.com/casbin/casbin/v2 v2.103.0 h1:dHElatNXNrr8XcseUov0ZSiWjauwmZZE6YMV3eU1yic= +github.com/casbin/casbin/v2 v2.103.0/go.mod h1:Ee33aqGrmES+GNL17L0h9X28wXuo829wnNUnS0edAco= github.com/casbin/govaluate v1.3.0 h1:VA0eSY0M2lA86dYd5kPPuNZMUD9QkWnOCnavGrw9myc= github.com/casbin/govaluate v1.3.0/go.mod h1:G/UnbIjZk/0uMNaLwZZmFQrR72tYRZWQkO70si/iR7A= github.com/cenkalti/backoff v2.1.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= From 9309688a8aeb06877e59c0de416f95562813da4d Mon Sep 17 00:00:00 2001 From: Siddhesh Ghadi <61187612+svghadi@users.noreply.github.com> Date: Mon, 30 Dec 2024 14:21:55 +0530 Subject: [PATCH 5/8] Stabilize on-deployed notification trigger (#21333) Signed-off-by: Siddhesh Ghadi --- notifications_catalog/install.yaml | 2 +- notifications_catalog/triggers/on-deployed.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/notifications_catalog/install.yaml b/notifications_catalog/install.yaml index 25aebf826e3d4..bba4a3af6a10b 100644 --- a/notifications_catalog/install.yaml +++ b/notifications_catalog/install.yaml @@ -491,7 +491,7 @@ data: send: - app-deployed when: app.status.operationState != nil and app.status.operationState.phase in ['Succeeded'] - and app.status.health.status == 'Healthy' + and app.status.health.status == 'Healthy' and !time.Parse(app.status.health.lastTransitionTime).Before(time.Parse(app.status.operationState.finishedAt)) trigger.on-health-degraded: | - description: Application has degraded send: diff --git a/notifications_catalog/triggers/on-deployed.yaml b/notifications_catalog/triggers/on-deployed.yaml index 486fb15bd94d8..3c06b49d40005 100644 --- a/notifications_catalog/triggers/on-deployed.yaml +++ b/notifications_catalog/triggers/on-deployed.yaml @@ -1,4 +1,4 @@ -- when: app.status.operationState != nil and app.status.operationState.phase in ['Succeeded'] and app.status.health.status == 'Healthy' +- when: app.status.operationState != nil and app.status.operationState.phase in ['Succeeded'] and app.status.health.status == 'Healthy' and !time.Parse(app.status.health.lastTransitionTime).Before(time.Parse(app.status.operationState.finishedAt)) description: Application is synced and healthy. Triggered once per commit. send: [app-deployed] oncePer: app.status.operationState?.syncResult?.revision From a4158226149bdec3f3df7b4e2499782978a8c5a9 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 30 Dec 2024 10:54:34 +0200 Subject: [PATCH 6/8] chore(deps): update dependency pymdown-extensions to v10.13 (#21301) Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- docs/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/requirements.txt b/docs/requirements.txt index cc472f5a8395a..c60526537e65d 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -6,4 +6,4 @@ markdown_include==0.8.1 pygments==2.18.0 jinja2==3.1.5 markdown==3.7 -pymdown-extensions==10.12 \ No newline at end of file +pymdown-extensions==10.13 \ No newline at end of file From 8a6f53d04412a0cef0233eeee7c2df68b6be8495 Mon Sep 17 00:00:00 2001 From: Matthieu MOREL Date: Mon, 30 Dec 2024 09:56:41 +0100 Subject: [PATCH 7/8] chore: enable errorf of perfsprint linter (#21280) Signed-off-by: Matthieu MOREL --- .golangci.yaml | 7 ++- .../applicationset_controller_test.go | 9 ++-- .../controllers/template/template_test.go | 6 +-- applicationset/generators/cluster_test.go | 8 ++-- applicationset/generators/duck_type.go | 7 +-- applicationset/generators/duck_type_test.go | 10 ++--- applicationset/generators/git_test.go | 23 +++++----- applicationset/generators/interface.go | 4 +- applicationset/generators/list.go | 3 +- applicationset/generators/matrix.go | 9 ++-- applicationset/generators/merge.go | 9 ++-- applicationset/generators/plugin.go | 5 ++- applicationset/generators/plugin_test.go | 11 ++--- applicationset/generators/pull_request.go | 3 +- .../generators/pull_request_test.go | 6 +-- applicationset/generators/scm_provider.go | 2 +- .../services/internal/http/client_test.go | 3 +- .../services/pull_request/bitbucket_cloud.go | 5 ++- applicationset/services/repo_service_test.go | 13 +++--- .../services/scm_provider/azure_devops.go | 2 +- .../scm_provider/azure_devops_test.go | 19 ++++---- .../services/scm_provider/bitbucket_cloud.go | 7 +-- applicationset/utils/createOrUpdate.go | 3 +- applicationset/utils/map_test.go | 4 +- applicationset/utils/utils.go | 5 ++- cmd/argocd-k8s-auth/commands/aws_test.go | 6 +-- cmd/argocd/commands/admin/app.go | 5 ++- cmd/argocd/commands/admin/project.go | 5 ++- cmd/argocd/commands/admin/repo.go | 10 ++--- cmd/argocd/commands/admin/settings.go | 3 +- cmd/argocd/commands/app.go | 44 +++++++++---------- cmd/argocd/commands/cert.go | 7 +-- cmd/argocd/commands/context.go | 5 ++- cmd/argocd/commands/gpg.go | 7 +-- cmd/argocd/commands/repo.go | 17 +++---- cmd/argocd/commands/repocreds.go | 11 ++--- cmd/util/app.go | 7 +-- cmd/util/cluster.go | 5 ++- cmpserver/plugin/config.go | 5 ++- cmpserver/plugin/plugin.go | 6 +-- commitserver/commit/commit.go | 9 ++-- controller/appcontroller.go | 6 +-- controller/clusterinfoupdater_test.go | 2 +- controller/sharding/sharding.go | 3 +- controller/sharding/sharding_test.go | 2 +- controller/state_test.go | 4 +- controller/sync.go | 4 +- pkg/apiclient/apiclient.go | 2 +- pkg/apiclient/grpcproxy.go | 2 +- pkg/apis/application/v1alpha1/types.go | 5 ++- reposerver/cache/cache.go | 2 +- reposerver/gpgwatcher.go | 3 +- reposerver/repository/repository.go | 8 ++-- reposerver/repository/repository_test.go | 14 +++--- server/application/application.go | 22 +++++----- server/application/application_test.go | 4 +- server/applicationset/applicationset.go | 9 ++-- server/extension/extension.go | 20 ++++----- server/gpgkey/gpgkey.go | 5 ++- test/e2e/deployment_test.go | 7 +-- test/e2e/fixture/cluster/consequences.go | 4 +- test/e2e/fixture/fixture.go | 4 +- test/e2e/fixture/repos/consequences.go | 4 +- util/app/discovery/discovery.go | 3 +- util/argo/argo.go | 5 ++- util/argo/argo_test.go | 4 +- util/argo/diff/diff.go | 5 ++- util/argo/normalizers/diff_normalizer.go | 6 +-- util/argo/normalizers/diff_normalizer_test.go | 4 +- util/argo/resource_tracking.go | 2 +- util/cache/cache.go | 3 +- util/cert/cert.go | 4 +- util/cli/cli.go | 3 +- util/cmp/stream.go | 6 +-- util/cmp/stream_test.go | 4 +- util/db/certificate.go | 3 +- util/db/gpgkeys.go | 5 ++- util/dex/config.go | 7 +-- util/dex/dex.go | 4 +- util/git/client.go | 6 +-- util/gpg/gpg.go | 9 ++-- util/grpc/errors_test.go | 6 +-- util/healthz/healthz_test.go | 4 +- util/helm/index.go | 2 +- util/io/path/resolved.go | 6 +-- util/kustomize/kustomize.go | 3 +- util/localconfig/localconfig.go | 3 +- util/localconfig/localconfig_test.go | 8 ++-- util/lua/lua.go | 4 +- util/manifeststream/stream.go | 12 ++--- util/manifeststream/stream_test.go | 6 +-- util/notification/settings/settings.go | 4 +- util/oidc/oidc.go | 2 +- util/password/password.go | 4 +- util/session/sessionmanager.go | 6 +-- util/settings/settings.go | 4 +- util/tls/tls.go | 6 +-- 97 files changed, 342 insertions(+), 292 deletions(-) diff --git a/.golangci.yaml b/.golangci.yaml index 1aea900d3cd11..ad92622481dbc 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -17,6 +17,7 @@ linters: - gomodguard - gosimple - govet + - importas - ineffassign - misspell - perfsprint @@ -47,13 +48,17 @@ linters-settings: - github.com/pkg/errors: recommendations: - errors + importas: + alias: + - alias: stderrors + pkg: errors perfsprint: # Optimizes even if it requires an int or uint type cast. int-conversion: true # Optimizes into `err.Error()` even if it is only equivalent for non-nil errors. err-error: true # Optimizes `fmt.Errorf`. - errorf: false + errorf: true # Optimizes `fmt.Sprintf` with only one argument. sprintf1: true # Optimizes into strings concatenation. diff --git a/applicationset/controllers/applicationset_controller_test.go b/applicationset/controllers/applicationset_controller_test.go index ec28e96d767e7..28c534ad5fd11 100644 --- a/applicationset/controllers/applicationset_controller_test.go +++ b/applicationset/controllers/applicationset_controller_test.go @@ -3,6 +3,7 @@ package controllers import ( "context" "encoding/json" + "errors" "fmt" "strconv" "testing" @@ -1864,7 +1865,7 @@ func TestRequeueGeneratorFails(t *testing.T) { generatorMock.On("GetTemplate", &generator). Return(&v1alpha1.ApplicationSetTemplate{}) generatorMock.On("GenerateParams", &generator, mock.AnythingOfType("*v1alpha1.ApplicationSet"), mock.Anything). - Return([]map[string]interface{}{}, fmt.Errorf("Simulated error generating params that could be related to an external service/API call")) + Return([]map[string]interface{}{}, errors.New("Simulated error generating params that could be related to an external service/API call")) metrics := appsetmetrics.NewFakeAppsetMetrics(client) @@ -1969,7 +1970,7 @@ func TestValidateGeneratedApplications(t *testing.T) { }, }, }, - validationErrors: map[int]error{0: fmt.Errorf("application destination spec is invalid: application destination can't have both name and server defined: my-cluster my-server")}, + validationErrors: map[int]error{0: errors.New("application destination spec is invalid: application destination can't have both name and server defined: my-cluster my-server")}, }, { name: "project mismatch should return error", @@ -1991,7 +1992,7 @@ func TestValidateGeneratedApplications(t *testing.T) { }, }, }, - validationErrors: map[int]error{0: fmt.Errorf("application references project DOES-NOT-EXIST which does not exist")}, + validationErrors: map[int]error{0: errors.New("application references project DOES-NOT-EXIST which does not exist")}, }, { name: "valid app should return true", @@ -2035,7 +2036,7 @@ func TestValidateGeneratedApplications(t *testing.T) { }, }, }, - validationErrors: map[int]error{0: fmt.Errorf("application destination spec is invalid: unable to find destination server: there are no clusters with this name: nonexistent-cluster")}, + validationErrors: map[int]error{0: errors.New("application destination spec is invalid: unable to find destination server: there are no clusters with this name: nonexistent-cluster")}, }, } { t.Run(cc.name, func(t *testing.T) { diff --git a/applicationset/controllers/template/template_test.go b/applicationset/controllers/template/template_test.go index 27e2c17f10073..1df037c13a566 100644 --- a/applicationset/controllers/template/template_test.go +++ b/applicationset/controllers/template/template_test.go @@ -1,7 +1,7 @@ package template import ( - "fmt" + "errors" "maps" "testing" @@ -53,7 +53,7 @@ func TestGenerateApplications(t *testing.T) { }, { name: "Handles error from the generator", - generateParamsError: fmt.Errorf("error"), + generateParamsError: errors.New("error"), expectErr: true, expectedReason: v1alpha1.ApplicationSetReasonApplicationParamsGenerationError, }, @@ -68,7 +68,7 @@ func TestGenerateApplications(t *testing.T) { }, Spec: v1alpha1.ApplicationSpec{}, }, - rendererError: fmt.Errorf("error"), + rendererError: errors.New("error"), expectErr: true, expectedReason: v1alpha1.ApplicationSetReasonRenderTemplateParamsError, }, diff --git a/applicationset/generators/cluster_test.go b/applicationset/generators/cluster_test.go index 30d8cf0347b23..57aefe847604c 100644 --- a/applicationset/generators/cluster_test.go +++ b/applicationset/generators/cluster_test.go @@ -2,7 +2,7 @@ package generators import ( "context" - "fmt" + "errors" "testing" corev1 "k8s.io/api/core/v1" @@ -27,7 +27,7 @@ type possiblyErroringFakeCtrlRuntimeClient struct { func (p *possiblyErroringFakeCtrlRuntimeClient) List(ctx context.Context, secretList client.ObjectList, opts ...client.ListOption) error { if p.shouldError { - return fmt.Errorf("could not list Secrets") + return errors.New("could not list Secrets") } return p.Client.List(ctx, secretList, opts...) } @@ -227,7 +227,7 @@ func TestGenerateParams(t *testing.T) { values: nil, expected: nil, clientError: true, - expectedError: fmt.Errorf("error getting cluster secrets: could not list Secrets"), + expectedError: errors.New("error getting cluster secrets: could not list Secrets"), }, { name: "flat mode without selectors", @@ -677,7 +677,7 @@ func TestGenerateParamsGoTemplate(t *testing.T) { values: nil, expected: nil, clientError: true, - expectedError: fmt.Errorf("error getting cluster secrets: could not list Secrets"), + expectedError: errors.New("error getting cluster secrets: could not list Secrets"), }, { name: "Clusters with flat list mode and no selector", diff --git a/applicationset/generators/duck_type.go b/applicationset/generators/duck_type.go index b971f7a1e0b1b..4d9d95f9cf4b8 100644 --- a/applicationset/generators/duck_type.go +++ b/applicationset/generators/duck_type.go @@ -2,6 +2,7 @@ package generators import ( "context" + "errors" "fmt" "strings" "time" @@ -96,13 +97,13 @@ func (g *DuckTypeGenerator) GenerateParams(appSetGenerator *argoprojiov1alpha1.A // Validate the fields if kind == "" || versionIdx < 1 { log.Warningf("kind=%v, resourceName=%v, versionIdx=%v", kind, resourceName, versionIdx) - return nil, fmt.Errorf("There is a problem with the apiVersion, kind or resourceName provided") + return nil, errors.New("There is a problem with the apiVersion, kind or resourceName provided") } if (resourceName == "" && labelSelector.MatchLabels == nil && labelSelector.MatchExpressions == nil) || (resourceName != "" && (labelSelector.MatchExpressions != nil || labelSelector.MatchLabels != nil)) { log.Warningf("You must choose either resourceName=%v, labelSelector.matchLabels=%v or labelSelect.matchExpressions=%v", resourceName, labelSelector.MatchLabels, labelSelector.MatchExpressions) - return nil, fmt.Errorf("There is a problem with the definition of the ClusterDecisionResource generator") + return nil, errors.New("There is a problem with the definition of the ClusterDecisionResource generator") } // Split up the apiVersion @@ -130,7 +131,7 @@ func (g *DuckTypeGenerator) GenerateParams(appSetGenerator *argoprojiov1alpha1.A if len(duckResources.Items) == 0 { log.Warning("no resource found, make sure you clusterDecisionResource is defined correctly") - return nil, fmt.Errorf("no clusterDecisionResources found") + return nil, errors.New("no clusterDecisionResources found") } // Override the duck type in the status of the resource diff --git a/applicationset/generators/duck_type_test.go b/applicationset/generators/duck_type_test.go index d2cfdbc59d6bc..4ac24f094edd2 100644 --- a/applicationset/generators/duck_type_test.go +++ b/applicationset/generators/duck_type_test.go @@ -2,7 +2,7 @@ package generators import ( "context" - "fmt" + "errors" "testing" "github.com/stretchr/testify/assert" @@ -160,7 +160,7 @@ func TestGenerateParamsForDuckType(t *testing.T) { resource: duckType, values: nil, expected: []map[string]interface{}{}, - expectedError: fmt.Errorf("There is a problem with the definition of the ClusterDecisionResource generator"), + expectedError: errors.New("There is a problem with the definition of the ClusterDecisionResource generator"), }, /*** This does not work with the FAKE runtime client, fieldSelectors are broken. { @@ -271,7 +271,7 @@ func TestGenerateParamsForDuckType(t *testing.T) { resource: duckType, values: nil, expected: nil, - expectedError: fmt.Errorf("There is a problem with the definition of the ClusterDecisionResource generator"), + expectedError: errors.New("There is a problem with the definition of the ClusterDecisionResource generator"), }, } @@ -456,7 +456,7 @@ func TestGenerateParamsForDuckTypeGoTemplate(t *testing.T) { resource: duckType, values: nil, expected: []map[string]interface{}{}, - expectedError: fmt.Errorf("There is a problem with the definition of the ClusterDecisionResource generator"), + expectedError: errors.New("There is a problem with the definition of the ClusterDecisionResource generator"), }, /*** This does not work with the FAKE runtime client, fieldSelectors are broken. { @@ -567,7 +567,7 @@ func TestGenerateParamsForDuckTypeGoTemplate(t *testing.T) { resource: duckType, values: nil, expected: nil, - expectedError: fmt.Errorf("There is a problem with the definition of the ClusterDecisionResource generator"), + expectedError: errors.New("There is a problem with the definition of the ClusterDecisionResource generator"), }, } diff --git a/applicationset/generators/git_test.go b/applicationset/generators/git_test.go index cd0c14d8443f0..cb7389ac6b0cf 100644 --- a/applicationset/generators/git_test.go +++ b/applicationset/generators/git_test.go @@ -1,6 +1,7 @@ package generators import ( + "errors" "fmt" "testing" @@ -307,9 +308,9 @@ func TestGitGenerateParamsFromDirectories(t *testing.T) { name: "handles error from repo server", directories: []argoprojiov1alpha1.GitDirectoryGeneratorItem{{Path: "*"}}, repoApps: []string{}, - repoError: fmt.Errorf("error"), + repoError: errors.New("error"), expected: []map[string]interface{}{}, - expectedError: fmt.Errorf("error generating params from git: error getting directories from repo: error"), + expectedError: errors.New("error generating params from git: error getting directories from repo: error"), }, } @@ -608,9 +609,9 @@ func TestGitGenerateParamsFromDirectoriesGoTemplate(t *testing.T) { name: "handles error from repo server", directories: []argoprojiov1alpha1.GitDirectoryGeneratorItem{{Path: "*"}}, repoApps: []string{}, - repoError: fmt.Errorf("error"), + repoError: errors.New("error"), expected: []map[string]interface{}{}, - expectedError: fmt.Errorf("error generating params from git: error getting directories from repo: error"), + expectedError: errors.New("error generating params from git: error getting directories from repo: error"), }, } @@ -808,9 +809,9 @@ func TestGitGenerateParamsFromFiles(t *testing.T) { name: "handles error during getting repo paths", files: []argoprojiov1alpha1.GitFileGeneratorItem{{Path: "**/config.json"}}, repoFileContents: map[string][]byte{}, - repoPathsError: fmt.Errorf("paths error"), + repoPathsError: errors.New("paths error"), expected: []map[string]interface{}{}, - expectedError: fmt.Errorf("error generating params from git: paths error"), + expectedError: errors.New("error generating params from git: paths error"), }, { name: "test invalid JSON file returns error", @@ -820,7 +821,7 @@ func TestGitGenerateParamsFromFiles(t *testing.T) { }, repoPathsError: nil, expected: []map[string]interface{}{}, - expectedError: fmt.Errorf("error generating params from git: unable to process file 'cluster-config/production/config.json': unable to parse file: error unmarshaling JSON: while decoding JSON: json: cannot unmarshal string into Go value of type map[string]interface {}"), + expectedError: errors.New("error generating params from git: unable to process file 'cluster-config/production/config.json': unable to parse file: error unmarshaling JSON: while decoding JSON: json: cannot unmarshal string into Go value of type map[string]interface {}"), }, { name: "test JSON array", @@ -1120,9 +1121,9 @@ func TestGitGenerateParamsFromFilesGoTemplate(t *testing.T) { name: "handles error during getting repo paths", files: []argoprojiov1alpha1.GitFileGeneratorItem{{Path: "**/config.json"}}, repoFileContents: map[string][]byte{}, - repoPathsError: fmt.Errorf("paths error"), + repoPathsError: errors.New("paths error"), expected: []map[string]interface{}{}, - expectedError: fmt.Errorf("error generating params from git: paths error"), + expectedError: errors.New("error generating params from git: paths error"), }, { name: "test invalid JSON file returns error", @@ -1132,7 +1133,7 @@ func TestGitGenerateParamsFromFilesGoTemplate(t *testing.T) { }, repoPathsError: nil, expected: []map[string]interface{}{}, - expectedError: fmt.Errorf("error generating params from git: unable to process file 'cluster-config/production/config.json': unable to parse file: error unmarshaling JSON: while decoding JSON: json: cannot unmarshal string into Go value of type map[string]interface {}"), + expectedError: errors.New("error generating params from git: unable to process file 'cluster-config/production/config.json': unable to parse file: error unmarshaling JSON: while decoding JSON: json: cannot unmarshal string into Go value of type map[string]interface {}"), }, { name: "test JSON array", @@ -1464,7 +1465,7 @@ func TestGitGenerator_GenerateParams(t *testing.T) { }, callGetDirectories: false, expected: []map[string]interface{}{{"path": "app1", "path.basename": "app1", "path.basenameNormalized": "app1", "path[0]": "app1", "values.foo": "bar"}}, - expectedError: fmt.Errorf("error getting project project: appprojects.argoproj.io \"project\" not found"), + expectedError: errors.New("error getting project project: appprojects.argoproj.io \"project\" not found"), }, } for _, testCase := range cases { diff --git a/applicationset/generators/interface.go b/applicationset/generators/interface.go index 88853c73b2b56..a43e3e9b8222f 100644 --- a/applicationset/generators/interface.go +++ b/applicationset/generators/interface.go @@ -1,7 +1,7 @@ package generators import ( - "fmt" + "errors" "time" "sigs.k8s.io/controller-runtime/pkg/client" @@ -27,7 +27,7 @@ type Generator interface { } var ( - EmptyAppSetGeneratorError = fmt.Errorf("ApplicationSet is empty") + EmptyAppSetGeneratorError = errors.New("ApplicationSet is empty") NoRequeueAfter time.Duration ) diff --git a/applicationset/generators/list.go b/applicationset/generators/list.go index 5980d95e77332..83f364c1a2cb2 100644 --- a/applicationset/generators/list.go +++ b/applicationset/generators/list.go @@ -2,6 +2,7 @@ package generators import ( "encoding/json" + "errors" "fmt" "time" @@ -54,7 +55,7 @@ func (g *ListGenerator) GenerateParams(appSetGenerator *argoprojiov1alpha1.Appli if key == "values" { values, ok := (value).(map[string]interface{}) if !ok { - return nil, fmt.Errorf("error parsing values map") + return nil, errors.New("error parsing values map") } for k, v := range values { value, ok := v.(string) diff --git a/applicationset/generators/matrix.go b/applicationset/generators/matrix.go index 2a44d97b71ac5..80b0d8a7fc052 100644 --- a/applicationset/generators/matrix.go +++ b/applicationset/generators/matrix.go @@ -1,6 +1,7 @@ package generators import ( + "errors" "fmt" "time" @@ -16,9 +17,9 @@ import ( var _ Generator = (*MatrixGenerator)(nil) var ( - ErrMoreThanTwoGenerators = fmt.Errorf("found more than two generators, Matrix support only two") - ErrLessThanTwoGenerators = fmt.Errorf("found less than two generators, Matrix support only two") - ErrMoreThenOneInnerGenerators = fmt.Errorf("found more than one generator in matrix.Generators") + ErrMoreThanTwoGenerators = errors.New("found more than two generators, Matrix support only two") + ErrLessThanTwoGenerators = errors.New("found less than two generators, Matrix support only two") + ErrMoreThenOneInnerGenerators = errors.New("found more than one generator in matrix.Generators") ) type MatrixGenerator struct { @@ -125,7 +126,7 @@ func (m *MatrixGenerator) getParams(appSetBaseGenerator argoprojiov1alpha1.Appli } if len(t) == 0 { - return nil, fmt.Errorf("child generator generated no parameters") + return nil, errors.New("child generator generated no parameters") } if len(t) > 1 { diff --git a/applicationset/generators/merge.go b/applicationset/generators/merge.go index e9af81fadae4e..a7de3a1f6ab4a 100644 --- a/applicationset/generators/merge.go +++ b/applicationset/generators/merge.go @@ -2,6 +2,7 @@ package generators import ( "encoding/json" + "errors" "fmt" "time" @@ -17,9 +18,9 @@ import ( var _ Generator = (*MergeGenerator)(nil) var ( - ErrLessThanTwoGeneratorsInMerge = fmt.Errorf("found less than two generators, Merge requires two or more") - ErrNoMergeKeys = fmt.Errorf("no merge keys were specified, Merge requires at least one") - ErrNonUniqueParamSets = fmt.Errorf("the parameters from a generator were not unique by the given mergeKeys, Merge requires all param sets to be unique") + ErrLessThanTwoGeneratorsInMerge = errors.New("found less than two generators, Merge requires two or more") + ErrNoMergeKeys = errors.New("no merge keys were specified, Merge requires at least one") + ErrNonUniqueParamSets = errors.New("the parameters from a generator were not unique by the given mergeKeys, Merge requires all param sets to be unique") ) type MergeGenerator struct { @@ -182,7 +183,7 @@ func (m *MergeGenerator) getParams(appSetBaseGenerator argoprojiov1alpha1.Applic } if len(t) == 0 { - return nil, fmt.Errorf("child generator generated no parameters") + return nil, errors.New("child generator generated no parameters") } if len(t) > 1 { diff --git a/applicationset/generators/plugin.go b/applicationset/generators/plugin.go index 6b6ba1ec4027e..f2c7f1d4a9781 100644 --- a/applicationset/generators/plugin.go +++ b/applicationset/generators/plugin.go @@ -2,6 +2,7 @@ package generators import ( "context" + "errors" "fmt" "strconv" "strings" @@ -194,12 +195,12 @@ func (g *PluginGenerator) getConfigMap(ctx context.Context, configMapRef string) baseUrl, ok := cm.Data["baseUrl"] if !ok || baseUrl == "" { - return nil, fmt.Errorf("baseUrl not found in ConfigMap") + return nil, errors.New("baseUrl not found in ConfigMap") } token, ok := cm.Data["token"] if !ok || token == "" { - return nil, fmt.Errorf("token not found in ConfigMap") + return nil, errors.New("token not found in ConfigMap") } return cm.Data, nil diff --git a/applicationset/generators/plugin_test.go b/applicationset/generators/plugin_test.go index 0ade708ee569b..5d65554db4355 100644 --- a/applicationset/generators/plugin_test.go +++ b/applicationset/generators/plugin_test.go @@ -3,6 +3,7 @@ package generators import ( "context" "encoding/json" + "errors" "fmt" "net/http" "net/http/httptest" @@ -371,7 +372,7 @@ func TestPluginGenerateParams(t *testing.T) { gotemplate: false, content: []byte(`wrong body ...`), expected: []map[string]interface{}{}, - expectedError: fmt.Errorf("error listing params: error get api 'set': invalid character 'w' looking for beginning of value: wrong body ..."), + expectedError: errors.New("error listing params: error get api 'set': invalid character 'w' looking for beginning of value: wrong body ..."), }, { name: "external secret", @@ -475,7 +476,7 @@ func TestPluginGenerateParams(t *testing.T) { }, }, }, - expectedError: fmt.Errorf("error getting plugin from generator: error fetching Secret token: error fetching secret default/argocd-secret: secrets \"argocd-secret\" not found"), + expectedError: errors.New("error getting plugin from generator: error fetching Secret token: error fetching secret default/argocd-secret: secrets \"argocd-secret\" not found"), }, { name: "no configmap", @@ -522,7 +523,7 @@ func TestPluginGenerateParams(t *testing.T) { }, }, }, - expectedError: fmt.Errorf("error getting plugin from generator: error fetching ConfigMap: configmaps \"\" not found"), + expectedError: errors.New("error getting plugin from generator: error fetching ConfigMap: configmaps \"\" not found"), }, { name: "no baseUrl", @@ -577,7 +578,7 @@ func TestPluginGenerateParams(t *testing.T) { }, }, }, - expectedError: fmt.Errorf("error getting plugin from generator: error fetching ConfigMap: baseUrl not found in ConfigMap"), + expectedError: errors.New("error getting plugin from generator: error fetching ConfigMap: baseUrl not found in ConfigMap"), }, { name: "no token", @@ -624,7 +625,7 @@ func TestPluginGenerateParams(t *testing.T) { }, }, }, - expectedError: fmt.Errorf("error getting plugin from generator: error fetching ConfigMap: token not found in ConfigMap"), + expectedError: errors.New("error getting plugin from generator: error fetching ConfigMap: token not found in ConfigMap"), }, } diff --git a/applicationset/generators/pull_request.go b/applicationset/generators/pull_request.go index f0c2bfaacfcf5..c1fd1a1c5ebc4 100644 --- a/applicationset/generators/pull_request.go +++ b/applicationset/generators/pull_request.go @@ -2,6 +2,7 @@ package generators import ( "context" + "errors" "fmt" "strconv" "time" @@ -205,7 +206,7 @@ func (g *PullRequestGenerator) selectServiceProvider(ctx context.Context, genera } return pullrequest.NewAzureDevOpsService(ctx, token, providerConfig.API, providerConfig.Organization, providerConfig.Project, providerConfig.Repo, providerConfig.Labels) } - return nil, fmt.Errorf("no Pull Request provider implementation configured") + return nil, errors.New("no Pull Request provider implementation configured") } func (g *PullRequestGenerator) github(ctx context.Context, cfg *argoprojiov1alpha1.PullRequestGeneratorGithub, applicationSetInfo *argoprojiov1alpha1.ApplicationSet) (pullrequest.PullRequestService, error) { diff --git a/applicationset/generators/pull_request_test.go b/applicationset/generators/pull_request_test.go index d4eae1602bfda..875c6cf73787e 100644 --- a/applicationset/generators/pull_request_test.go +++ b/applicationset/generators/pull_request_test.go @@ -2,7 +2,7 @@ package generators import ( "context" - "fmt" + "errors" "testing" "github.com/stretchr/testify/assert" @@ -125,11 +125,11 @@ func TestPullRequestGithubGenerateParams(t *testing.T) { return pullrequest.NewFakeService( ctx, nil, - fmt.Errorf("fake error"), + errors.New("fake error"), ) }, expected: nil, - expectedErr: fmt.Errorf("error listing repos: fake error"), + expectedErr: errors.New("error listing repos: fake error"), }, { selectFunc: func(context.Context, *argoprojiov1alpha1.PullRequestGenerator, *argoprojiov1alpha1.ApplicationSet) (pullrequest.PullRequestService, error) { diff --git a/applicationset/generators/scm_provider.go b/applicationset/generators/scm_provider.go index 417b682e50511..cf476ceeba51d 100644 --- a/applicationset/generators/scm_provider.go +++ b/applicationset/generators/scm_provider.go @@ -226,7 +226,7 @@ func (g *SCMProviderGenerator) GenerateParams(appSetGenerator *argoprojiov1alpha return nil, fmt.Errorf("error initializing AWS codecommit service: %w", awsErr) } } else { - return nil, fmt.Errorf("no SCM provider implementation configured") + return nil, errors.New("no SCM provider implementation configured") } // Find all the available repos. diff --git a/applicationset/services/internal/http/client_test.go b/applicationset/services/internal/http/client_test.go index 29c183b5b2481..a38e17474e122 100644 --- a/applicationset/services/internal/http/client_test.go +++ b/applicationset/services/internal/http/client_test.go @@ -3,6 +3,7 @@ package http import ( "bytes" "context" + "errors" "fmt" "io" "net/http" @@ -109,7 +110,7 @@ func TestClientDo(t *testing.T) { clientOptionFns: nil, expected: []map[string]interface{}(nil), expectedCode: http.StatusUnauthorized, - expectedError: fmt.Errorf("API error with status code 401: "), + expectedError: errors.New("API error with status code 401: "), }, } { cc := c diff --git a/applicationset/services/pull_request/bitbucket_cloud.go b/applicationset/services/pull_request/bitbucket_cloud.go index 2ee79d2cfabee..a9b2daf7be43b 100644 --- a/applicationset/services/pull_request/bitbucket_cloud.go +++ b/applicationset/services/pull_request/bitbucket_cloud.go @@ -3,6 +3,7 @@ package pull_request import ( "context" "encoding/json" + "errors" "fmt" "net/url" @@ -114,12 +115,12 @@ func (b *BitbucketCloudService) List(_ context.Context) ([]*PullRequest, error) resp, ok := response.(map[string]interface{}) if !ok { - return nil, fmt.Errorf("unknown type returned from bitbucket pull requests") + return nil, errors.New("unknown type returned from bitbucket pull requests") } repoArray, ok := resp["values"].([]interface{}) if !ok { - return nil, fmt.Errorf("unknown type returned from response values") + return nil, errors.New("unknown type returned from response values") } jsonStr, err := json.Marshal(repoArray) diff --git a/applicationset/services/repo_service_test.go b/applicationset/services/repo_service_test.go index c621c317a9f4f..249d758a79b12 100644 --- a/applicationset/services/repo_service_test.go +++ b/applicationset/services/repo_service_test.go @@ -2,6 +2,7 @@ package services import ( "context" + "errors" "fmt" "testing" @@ -39,7 +40,7 @@ func TestGetDirectories(t *testing.T) { }{ {name: "ErrorGettingRepos", fields: fields{ getRepository: func(ctx context.Context, url, project string) (*v1alpha1.Repository, error) { - return nil, fmt.Errorf("unable to get repos") + return nil, errors.New("unable to get repos") }, }, args: args{}, want: nil, wantErr: assert.Error}, {name: "ErrorGettingDirs", fields: fields{ @@ -48,7 +49,7 @@ func TestGetDirectories(t *testing.T) { }, repoServerClientFuncs: []func(*repo_mocks.RepoServerServiceClient){ func(client *repo_mocks.RepoServerServiceClient) { - client.On("GetGitDirectories", mock.Anything, mock.Anything).Return(nil, fmt.Errorf("unable to get dirs")) + client.On("GetGitDirectories", mock.Anything, mock.Anything).Return(nil, errors.New("unable to get dirs")) }, }, }, args: args{}, want: nil, wantErr: assert.Error}, @@ -70,7 +71,7 @@ func TestGetDirectories(t *testing.T) { }, repoServerClientFuncs: []func(*repo_mocks.RepoServerServiceClient){ func(client *repo_mocks.RepoServerServiceClient) { - client.On("GetGitDirectories", mock.Anything, mock.Anything).Return(nil, fmt.Errorf("revision HEAD is not signed")) + client.On("GetGitDirectories", mock.Anything, mock.Anything).Return(nil, errors.New("revision HEAD is not signed")) }, }, }, args: args{}, want: nil, wantErr: assert.Error}, @@ -122,7 +123,7 @@ func TestGetFiles(t *testing.T) { }{ {name: "ErrorGettingRepos", fields: fields{ getRepository: func(ctx context.Context, url, project string) (*v1alpha1.Repository, error) { - return nil, fmt.Errorf("unable to get repos") + return nil, errors.New("unable to get repos") }, }, args: args{}, want: nil, wantErr: assert.Error}, {name: "ErrorGettingFiles", fields: fields{ @@ -131,7 +132,7 @@ func TestGetFiles(t *testing.T) { }, repoServerClientFuncs: []func(*repo_mocks.RepoServerServiceClient){ func(client *repo_mocks.RepoServerServiceClient) { - client.On("GetGitFiles", mock.Anything, mock.Anything).Return(nil, fmt.Errorf("unable to get files")) + client.On("GetGitFiles", mock.Anything, mock.Anything).Return(nil, errors.New("unable to get files")) }, }, }, args: args{}, want: nil, wantErr: assert.Error}, @@ -159,7 +160,7 @@ func TestGetFiles(t *testing.T) { }, repoServerClientFuncs: []func(*repo_mocks.RepoServerServiceClient){ func(client *repo_mocks.RepoServerServiceClient) { - client.On("GetGitFiles", mock.Anything, mock.Anything).Return(nil, fmt.Errorf("revision HEAD is not signed")) + client.On("GetGitFiles", mock.Anything, mock.Anything).Return(nil, errors.New("revision HEAD is not signed")) }, }, }, args: args{}, want: nil, wantErr: assert.Error}, diff --git a/applicationset/services/scm_provider/azure_devops.go b/applicationset/services/scm_provider/azure_devops.go index a4bb50a0232e3..b43f57b96930b 100644 --- a/applicationset/services/scm_provider/azure_devops.go +++ b/applicationset/services/scm_provider/azure_devops.go @@ -59,7 +59,7 @@ var ( func NewAzureDevOpsProvider(ctx context.Context, accessToken string, org string, url string, project string, allBranches bool) (*AzureDevOpsProvider, error) { if accessToken == "" { - return nil, fmt.Errorf("no access token provided") + return nil, errors.New("no access token provided") } devOpsURL, err := getValidDevOpsURL(url, org) diff --git a/applicationset/services/scm_provider/azure_devops_test.go b/applicationset/services/scm_provider/azure_devops_test.go index d718802ad3295..9b3ecb6629146 100644 --- a/applicationset/services/scm_provider/azure_devops_test.go +++ b/applicationset/services/scm_provider/azure_devops_test.go @@ -2,6 +2,7 @@ package scm_provider import ( "context" + "errors" "fmt" "testing" @@ -41,7 +42,7 @@ func TestAzureDevopsRepoHasPath(t *testing.T) { }{ { name: "RepoHasPath when Azure DevOps client factory fails returns error", - clientError: fmt.Errorf("Client factory error"), + clientError: errors.New("Client factory error"), }, { name: "RepoHasPath when found returns true", @@ -62,7 +63,7 @@ func TestAzureDevopsRepoHasPath(t *testing.T) { { name: "RepoHasPath when unknown Azure DevOps error occurs returns error", pathFound: false, - azureDevopsError: fmt.Errorf("Undefined error from Azure Devops"), + azureDevopsError: errors.New("Undefined error from Azure Devops"), returnError: true, errorMessage: "failed to check for path existence", }, @@ -133,7 +134,7 @@ func TestGetDefaultBranchOnDisabledRepo(t *testing.T) { }, { name: "other error when calling azure devops returns error", - azureDevOpsError: fmt.Errorf("some unknown error"), + azureDevOpsError: errors.New("some unknown error"), shouldReturnError: true, }, } @@ -192,7 +193,7 @@ func TestGetAllBranchesOnDisabledRepo(t *testing.T) { }, { name: "other error when calling azure devops returns error", - azureDevOpsError: fmt.Errorf("some unknown error"), + azureDevOpsError: errors.New("some unknown error"), shouldReturnError: true, }, } @@ -280,11 +281,11 @@ func TestAzureDevOpsGetBranchesDefultBranchOnly(t *testing.T) { }, { name: "GetBranches AllBranches false when request fails returns error and empty result", - getBranchesApiError: fmt.Errorf("Remote Azure Devops GetBranches error"), + getBranchesApiError: errors.New("Remote Azure Devops GetBranches error"), }, { name: "GetBranches AllBranches false when Azure DevOps client fails returns error", - clientError: fmt.Errorf("Could not get Azure Devops API client"), + clientError: errors.New("Could not get Azure Devops API client"), }, { name: "GetBranches AllBranches false when branch returned with long commit SHA", @@ -352,7 +353,7 @@ func TestAzureDevopsGetBranches(t *testing.T) { }, { name: "GetBranches when Azure DevOps request fails returns error and empty result", - getBranchesApiError: fmt.Errorf("Remote Azure Devops GetBranches error"), + getBranchesApiError: errors.New("Remote Azure Devops GetBranches error"), allBranches: true, }, { @@ -362,7 +363,7 @@ func TestAzureDevopsGetBranches(t *testing.T) { }, { name: "GetBranches when git client retrievel fails returns error", - clientError: fmt.Errorf("Could not get Azure Devops API client"), + clientError: errors.New("Could not get Azure Devops API client"), allBranches: true, }, { @@ -447,7 +448,7 @@ func TestGetAzureDevopsRepositories(t *testing.T) { }, { name: "ListRepos when Azure DevOps request fails returns error", - getRepositoriesError: fmt.Errorf("Could not get repos"), + getRepositoriesError: errors.New("Could not get repos"), }, { name: "ListRepos when repo has no name returns empty list", diff --git a/applicationset/services/scm_provider/bitbucket_cloud.go b/applicationset/services/scm_provider/bitbucket_cloud.go index 4468aee687f7d..d01ddbb6185dd 100644 --- a/applicationset/services/scm_provider/bitbucket_cloud.go +++ b/applicationset/services/scm_provider/bitbucket_cloud.go @@ -2,6 +2,7 @@ package scm_provider import ( "context" + "errors" "fmt" "net/http" "strings" @@ -155,17 +156,17 @@ func (g *BitBucketCloudProvider) listBranches(repo *Repository) ([]bitbucket.Rep func findCloneURL(cloneProtocol string, repo *bitbucket.Repository) (*string, error) { cloneLinks, ok := repo.Links["clone"].([]interface{}) if !ok { - return nil, fmt.Errorf("unknown type returned from repo links") + return nil, errors.New("unknown type returned from repo links") } for _, link := range cloneLinks { linkEntry, ok := link.(map[string]interface{}) if !ok { - return nil, fmt.Errorf("unknown type returned from clone link") + return nil, errors.New("unknown type returned from clone link") } if linkEntry["name"] == cloneProtocol { url, ok := linkEntry["href"].(string) if !ok { - return nil, fmt.Errorf("could not find href for clone link") + return nil, errors.New("could not find href for clone link") } return &url, nil } diff --git a/applicationset/utils/createOrUpdate.go b/applicationset/utils/createOrUpdate.go index c602f002b0d47..8cde366e2dfd8 100644 --- a/applicationset/utils/createOrUpdate.go +++ b/applicationset/utils/createOrUpdate.go @@ -3,6 +3,7 @@ package utils import ( "context" "encoding/json" + stderrors "errors" "fmt" log "github.com/sirupsen/logrus" @@ -128,7 +129,7 @@ func mutate(f controllerutil.MutateFn, key client.ObjectKey, obj client.Object) return fmt.Errorf("error while wrapping using MutateFn: %w", err) } if newKey := client.ObjectKeyFromObject(obj); key != newKey { - return fmt.Errorf("MutateFn cannot mutate object name and/or object namespace") + return stderrors.New("MutateFn cannot mutate object name and/or object namespace") } return nil } diff --git a/applicationset/utils/map_test.go b/applicationset/utils/map_test.go index c12216e0e1ac6..be033175d61f9 100644 --- a/applicationset/utils/map_test.go +++ b/applicationset/utils/map_test.go @@ -1,7 +1,7 @@ package utils import ( - "fmt" + "errors" "testing" "github.com/stretchr/testify/assert" @@ -28,7 +28,7 @@ func TestCombineStringMaps(t *testing.T) { left: map[string]interface{}{"foo": "bar", "a": "fail"}, right: map[string]interface{}{"a": "b", "c": "d"}, expected: map[string]string{"a": "b", "foo": "bar"}, - expectedErr: fmt.Errorf("found duplicate key a with different value, a: fail ,b: b"), + expectedErr: errors.New("found duplicate key a with different value, a: fail ,b: b"), }, { name: "pass if keys & values are the same", diff --git a/applicationset/utils/utils.go b/applicationset/utils/utils.go index 4122dee28a657..4bfca4971bada 100644 --- a/applicationset/utils/utils.go +++ b/applicationset/utils/utils.go @@ -5,6 +5,7 @@ import ( "crypto/tls" "crypto/x509" "encoding/json" + "errors" "fmt" "io" "os" @@ -251,7 +252,7 @@ func isNillable(v reflect.Value) bool { func (r *Render) RenderTemplateParams(tmpl *argoappsv1.Application, syncPolicy *argoappsv1.ApplicationSetSyncPolicy, params map[string]interface{}, useGoTemplate bool, goTemplateOptions []string) (*argoappsv1.Application, error) { if tmpl == nil { - return nil, fmt.Errorf("application template is empty") + return nil, errors.New("application template is empty") } if len(params) == 0 { @@ -282,7 +283,7 @@ func (r *Render) RenderTemplateParams(tmpl *argoappsv1.Application, syncPolicy * func (r *Render) RenderGeneratorParams(gen *argoappsv1.ApplicationSetGenerator, params map[string]interface{}, useGoTemplate bool, goTemplateOptions []string) (*argoappsv1.ApplicationSetGenerator, error) { if gen == nil { - return nil, fmt.Errorf("generator is empty") + return nil, errors.New("generator is empty") } if len(params) == 0 { diff --git a/cmd/argocd-k8s-auth/commands/aws_test.go b/cmd/argocd-k8s-auth/commands/aws_test.go index 7e31e50efbba8..37d9e9ea0477b 100644 --- a/cmd/argocd-k8s-auth/commands/aws_test.go +++ b/cmd/argocd-k8s-auth/commands/aws_test.go @@ -2,7 +2,7 @@ package commands import ( "context" - "fmt" + "errors" "testing" "time" @@ -35,7 +35,7 @@ func TestGetSignedRequestWithRetry(t *testing.T) { mock := &signedRequestMock{ returnFunc: func(m *signedRequestMock) (string, error) { if m.getSignedRequestCalls < 3 { - return "", fmt.Errorf("some error") + return "", errors.New("some error") } return "token", nil }, @@ -53,7 +53,7 @@ func TestGetSignedRequestWithRetry(t *testing.T) { t.Parallel() mock := &signedRequestMock{ returnFunc: func(m *signedRequestMock) (string, error) { - return "", fmt.Errorf("some error") + return "", errors.New("some error") }, } diff --git a/cmd/argocd/commands/admin/app.go b/cmd/argocd/commands/admin/app.go index 0eb799b322570..68500577efa78 100644 --- a/cmd/argocd/commands/admin/app.go +++ b/cmd/argocd/commands/admin/app.go @@ -3,6 +3,7 @@ package admin import ( "context" "encoding/json" + stderrors "errors" "fmt" "net/http" "os" @@ -106,7 +107,7 @@ func NewGenAppSpecCommand() *cobra.Command { apps, err := cmdutil.ConstructApps(fileURL, appName, labels, annotations, args, appOpts, c.Flags()) errors.CheckError(err) if len(apps) > 1 { - errors.CheckError(fmt.Errorf("failed to generate spec, more than one application is not supported")) + errors.CheckError(stderrors.New("failed to generate spec, more than one application is not supported")) } app := apps[0] if app.Name == "" { @@ -378,7 +379,7 @@ func reconcileApplications( go appInformer.Run(ctx.Done()) go projInformer.Run(ctx.Done()) if !kubecache.WaitForCacheSync(ctx.Done(), appInformer.HasSynced, projInformer.HasSynced) { - return nil, fmt.Errorf("failed to sync cache") + return nil, stderrors.New("failed to sync cache") } appLister := appInformerFactory.Argoproj().V1alpha1().Applications().Lister() diff --git a/cmd/argocd/commands/admin/project.go b/cmd/argocd/commands/admin/project.go index 3570afbb1a61d..6f639349786ac 100644 --- a/cmd/argocd/commands/admin/project.go +++ b/cmd/argocd/commands/admin/project.go @@ -2,6 +2,7 @@ package admin import ( "context" + stderrors "errors" "fmt" "os" "path/filepath" @@ -96,10 +97,10 @@ func getModification(modification string, resource string, scope string, permiss switch modification { case "set": if scope == "" { - return nil, fmt.Errorf("Flag --group cannot be empty if permission should be set in role") + return nil, stderrors.New("Flag --group cannot be empty if permission should be set in role") } if permission == "" { - return nil, fmt.Errorf("Flag --permission cannot be empty if permission should be set in role") + return nil, stderrors.New("Flag --permission cannot be empty if permission should be set in role") } return func(proj string, action string) string { return fmt.Sprintf("%s, %s, %s/%s, %s", resource, action, proj, scope, permission) diff --git a/cmd/argocd/commands/admin/repo.go b/cmd/argocd/commands/admin/repo.go index 84933ab0c0cc5..2e2d70336cb3d 100644 --- a/cmd/argocd/commands/admin/repo.go +++ b/cmd/argocd/commands/admin/repo.go @@ -1,7 +1,7 @@ package admin import ( - "fmt" + stderrors "errors" "os" log "github.com/sirupsen/logrus" @@ -92,7 +92,7 @@ func NewGenRepoSpecCommand() *cobra.Command { } repoOpts.Repo.SSHPrivateKey = string(keyData) } else { - err := fmt.Errorf("--ssh-private-key-path is only supported for SSH repositories") + err := stderrors.New("--ssh-private-key-path is only supported for SSH repositories") errors.CheckError(err) } } @@ -100,7 +100,7 @@ func NewGenRepoSpecCommand() *cobra.Command { // tls-client-cert-path and tls-client-cert-key-key-path must always be // specified together if (repoOpts.TlsClientCertPath != "" && repoOpts.TlsClientCertKeyPath == "") || (repoOpts.TlsClientCertPath == "" && repoOpts.TlsClientCertKeyPath != "") { - err := fmt.Errorf("--tls-client-cert-path and --tls-client-cert-key-path must be specified together") + err := stderrors.New("--tls-client-cert-path and --tls-client-cert-key-path must be specified together") errors.CheckError(err) } @@ -114,7 +114,7 @@ func NewGenRepoSpecCommand() *cobra.Command { repoOpts.Repo.TLSClientCertData = string(tlsCertData) repoOpts.Repo.TLSClientCertKey = string(tlsCertKey) } else { - err := fmt.Errorf("--tls-client-cert-path is only supported for HTTPS repositories") + err := stderrors.New("--tls-client-cert-path is only supported for HTTPS repositories") errors.CheckError(err) } } @@ -128,7 +128,7 @@ func NewGenRepoSpecCommand() *cobra.Command { repoOpts.Repo.EnableOCI = repoOpts.EnableOci if repoOpts.Repo.Type == "helm" && repoOpts.Repo.Name == "" { - errors.CheckError(fmt.Errorf("must specify --name for repos of type 'helm'")) + errors.CheckError(stderrors.New("must specify --name for repos of type 'helm'")) } // If the user set a username, but didn't supply password via --password, diff --git a/cmd/argocd/commands/admin/settings.go b/cmd/argocd/commands/admin/settings.go index 78fac6ca2246d..aaccadafe51d0 100644 --- a/cmd/argocd/commands/admin/settings.go +++ b/cmd/argocd/commands/admin/settings.go @@ -3,6 +3,7 @@ package admin import ( "bytes" "context" + stderrors "errors" "fmt" "os" "reflect" @@ -64,7 +65,7 @@ func setSettingsMeta(obj v1.Object) { func (opts *settingsOpts) createSettingsManager(ctx context.Context) (*settings.SettingsManager, error) { var argocdCM *corev1.ConfigMap if opts.argocdCMPath == "" && !opts.loadClusterSettings { - return nil, fmt.Errorf("either --argocd-cm-path must be provided or --load-cluster-settings must be set to true") + return nil, stderrors.New("either --argocd-cm-path must be provided or --load-cluster-settings must be set to true") } else if opts.argocdCMPath == "" { realClientset, ns, err := opts.getK8sClient() if err != nil { diff --git a/cmd/argocd/commands/app.go b/cmd/argocd/commands/app.go index 50230e0bb354b..0b7245def64cd 100644 --- a/cmd/argocd/commands/app.go +++ b/cmd/argocd/commands/app.go @@ -3,7 +3,7 @@ package commands import ( "context" "encoding/json" - std_errors "errors" + stderrors "errors" "fmt" "io" "os" @@ -400,7 +400,7 @@ func NewApplicationGetCommand(clientOpts *argocdclient.ClientOptions) *cobra.Com errors.CheckError(err) if sourceName != "" && sourcePosition != -1 { - errors.CheckError(fmt.Errorf("Only one of source-position and source-name can be specified.")) + errors.CheckError(stderrors.New("Only one of source-position and source-name can be specified.")) } if sourceName != "" { @@ -415,10 +415,10 @@ func NewApplicationGetCommand(clientOpts *argocdclient.ClientOptions) *cobra.Com // check for source position if --show-params is set if app.Spec.HasMultipleSources() && showParams { if sourcePosition <= 0 { - errors.CheckError(fmt.Errorf("Source position should be specified and must be greater than 0 for applications with multiple sources")) + errors.CheckError(stderrors.New("Source position should be specified and must be greater than 0 for applications with multiple sources")) } if len(app.Spec.GetSources()) < sourcePosition { - errors.CheckError(fmt.Errorf("Source position should be less than the number of sources in the application")) + errors.CheckError(stderrors.New("Source position should be less than the number of sources in the application")) } } @@ -563,7 +563,7 @@ func NewApplicationLogsCommand(clientOpts *argocdclient.ClientOptions) *cobra.Co for { msg, err := stream.Recv() if err != nil { - if std_errors.Is(err, io.EOF) { + if stderrors.Is(err, io.EOF) { return } st, ok := status.FromError(err) @@ -835,7 +835,7 @@ func NewApplicationSetCommand(clientOpts *argocdclient.ClientOptions) *cobra.Com sourceName = appOpts.SourceName if sourceName != "" && sourcePosition != -1 { - errors.CheckError(fmt.Errorf("Only one of source-position and source-name can be specified.")) + errors.CheckError(stderrors.New("Only one of source-position and source-name can be specified.")) } if sourceName != "" { @@ -849,10 +849,10 @@ func NewApplicationSetCommand(clientOpts *argocdclient.ClientOptions) *cobra.Com if app.Spec.HasMultipleSources() { if sourcePosition <= 0 { - errors.CheckError(fmt.Errorf("Source position should be specified and must be greater than 0 for applications with multiple sources")) + errors.CheckError(stderrors.New("Source position should be specified and must be greater than 0 for applications with multiple sources")) } if len(app.Spec.GetSources()) < sourcePosition { - errors.CheckError(fmt.Errorf("Source position should be less than the number of sources in the application")) + errors.CheckError(stderrors.New("Source position should be less than the number of sources in the application")) } } @@ -948,7 +948,7 @@ func NewApplicationUnsetCommand(clientOpts *argocdclient.ClientOptions) *cobra.C sourceName = appOpts.SourceName if sourceName != "" && sourcePosition != -1 { - errors.CheckError(fmt.Errorf("Only one of source-position and source-name can be specified.")) + errors.CheckError(stderrors.New("Only one of source-position and source-name can be specified.")) } if sourceName != "" { @@ -962,10 +962,10 @@ func NewApplicationUnsetCommand(clientOpts *argocdclient.ClientOptions) *cobra.C if app.Spec.HasMultipleSources() { if sourcePosition <= 0 { - errors.CheckError(fmt.Errorf("Source position should be specified and must be greater than 0 for applications with multiple sources")) + errors.CheckError(stderrors.New("Source position should be specified and must be greater than 0 for applications with multiple sources")) } if len(app.Spec.GetSources()) < sourcePosition { - errors.CheckError(fmt.Errorf("Source position should be less than the number of sources in the application")) + errors.CheckError(stderrors.New("Source position should be less than the number of sources in the application")) } } @@ -1245,15 +1245,15 @@ func NewApplicationDiffCommand(clientOpts *argocdclient.ClientOptions) *cobra.Co } if len(sourceNames) > 0 && len(sourcePositions) > 0 { - errors.CheckError(fmt.Errorf("Only one of source-positions and source-names can be specified.")) + errors.CheckError(stderrors.New("Only one of source-positions and source-names can be specified.")) } if len(sourcePositions) > 0 && len(revisions) != len(sourcePositions) { - errors.CheckError(fmt.Errorf("While using --revisions and --source-positions, length of values for both flags should be same.")) + errors.CheckError(stderrors.New("While using --revisions and --source-positions, length of values for both flags should be same.")) } if len(sourceNames) > 0 && len(revisions) != len(sourceNames) { - errors.CheckError(fmt.Errorf("While using --revisions and --source-names, length of values for both flags should be same.")) + errors.CheckError(stderrors.New("While using --revisions and --source-names, length of values for both flags should be same.")) } clientset := headless.NewClientOrDie(clientOpts, c) @@ -2972,15 +2972,15 @@ func NewApplicationManifestsCommand(clientOpts *argocdclient.ClientOptions) *cob } if len(sourceNames) > 0 && len(sourcePositions) > 0 { - errors.CheckError(fmt.Errorf("Only one of source-positions and source-names can be specified.")) + errors.CheckError(stderrors.New("Only one of source-positions and source-names can be specified.")) } if len(sourcePositions) > 0 && len(revisions) != len(sourcePositions) { - errors.CheckError(fmt.Errorf("While using --revisions and --source-positions, length of values for both flags should be same.")) + errors.CheckError(stderrors.New("While using --revisions and --source-positions, length of values for both flags should be same.")) } if len(sourceNames) > 0 && len(revisions) != len(sourceNames) { - errors.CheckError(fmt.Errorf("While using --revisions and --source-names, length of values for both flags should be same.")) + errors.CheckError(stderrors.New("While using --revisions and --source-names, length of values for both flags should be same.")) } for _, pos := range sourcePositions { @@ -3262,7 +3262,7 @@ func NewApplicationAddSourceCommand(clientOpts *argocdclient.ClientOptions) *cob errors.CheckError(err) if c.Flags() == nil { - errors.CheckError(fmt.Errorf("ApplicationSource needs atleast repoUrl, path or chart or ref field. No source to add.")) + errors.CheckError(stderrors.New("ApplicationSource needs atleast repoUrl, path or chart or ref field. No source to add.")) } if len(app.Spec.Sources) > 0 { @@ -3317,7 +3317,7 @@ func NewApplicationRemoveSourceCommand(clientOpts *argocdclient.ClientOptions) * } if sourceName == "" && sourcePosition <= 0 { - errors.CheckError(fmt.Errorf("Value of source-position must be greater than 0")) + errors.CheckError(stderrors.New("Value of source-position must be greater than 0")) } argocdClient := headless.NewClientOrDie(clientOpts, c) @@ -3334,7 +3334,7 @@ func NewApplicationRemoveSourceCommand(clientOpts *argocdclient.ClientOptions) * errors.CheckError(err) if sourceName != "" && sourcePosition != -1 { - errors.CheckError(fmt.Errorf("Only one of source-position and source-name can be specified.")) + errors.CheckError(stderrors.New("Only one of source-position and source-name can be specified.")) } if sourceName != "" { @@ -3347,11 +3347,11 @@ func NewApplicationRemoveSourceCommand(clientOpts *argocdclient.ClientOptions) * } if !app.Spec.HasMultipleSources() { - errors.CheckError(fmt.Errorf("Application does not have multiple sources configured")) + errors.CheckError(stderrors.New("Application does not have multiple sources configured")) } if len(app.Spec.GetSources()) == 1 { - errors.CheckError(fmt.Errorf("Cannot remove the only source remaining in the app")) + errors.CheckError(stderrors.New("Cannot remove the only source remaining in the app")) } if len(app.Spec.GetSources()) < sourcePosition { diff --git a/cmd/argocd/commands/cert.go b/cmd/argocd/commands/cert.go index d123a9ae66599..e20243d55c141 100644 --- a/cmd/argocd/commands/cert.go +++ b/cmd/argocd/commands/cert.go @@ -2,6 +2,7 @@ package commands import ( "crypto/x509" + stderrors "errors" "fmt" "os" "sort" @@ -167,13 +168,13 @@ func NewCertAddSSHCommand(clientOpts *argocdclient.ClientOptions) *cobra.Command sshKnownHostsLists, err = certutil.ParseSSHKnownHostsFromStream(os.Stdin) } } else { - err = fmt.Errorf("You need to specify --batch or specify --help for usage instructions") + err = stderrors.New("You need to specify --batch or specify --help for usage instructions") } errors.CheckError(err) if len(sshKnownHostsLists) == 0 { - errors.CheckError(fmt.Errorf("No valid SSH known hosts data found.")) + errors.CheckError(stderrors.New("No valid SSH known hosts data found.")) } for _, knownHostsEntry := range sshKnownHostsLists { @@ -234,7 +235,7 @@ func NewCertRemoveCommand(clientOpts *argocdclient.ClientOptions) *cobra.Command // remove all certificates, but it's less likely that it happens by // accident. if hostNamePattern == "*" { - err := fmt.Errorf("A single wildcard is not allowed as REPOSERVER name.") + err := stderrors.New("A single wildcard is not allowed as REPOSERVER name.") errors.CheckError(err) } diff --git a/cmd/argocd/commands/context.go b/cmd/argocd/commands/context.go index 2c4b37ba2fa81..f07f007249679 100644 --- a/cmd/argocd/commands/context.go +++ b/cmd/argocd/commands/context.go @@ -1,6 +1,7 @@ package commands import ( + stderrors "errors" "fmt" "os" "path" @@ -85,7 +86,7 @@ func deleteContext(context, configPath string) error { localCfg, err := localconfig.ReadLocalConfig(configPath) errors.CheckError(err) if localCfg == nil { - return fmt.Errorf("Nothing to logout from") + return stderrors.New("Nothing to logout from") } serverName, ok := localCfg.RemoveContext(context) @@ -104,7 +105,7 @@ func deleteContext(context, configPath string) error { } err = localconfig.ValidateLocalConfig(*localCfg) if err != nil { - return fmt.Errorf("Error in logging out") + return stderrors.New("Error in logging out") } err = localconfig.WriteLocalConfig(*localCfg, configPath) errors.CheckError(err) diff --git a/cmd/argocd/commands/gpg.go b/cmd/argocd/commands/gpg.go index bc50655cfaec4..02cd7adea1a50 100644 --- a/cmd/argocd/commands/gpg.go +++ b/cmd/argocd/commands/gpg.go @@ -1,6 +1,7 @@ package commands import ( + stderrors "errors" "fmt" "os" "strings" @@ -96,7 +97,7 @@ func NewGPGGetCommand(clientOpts *argocdclient.ClientOptions) *cobra.Command { ctx := c.Context() if len(args) != 1 { - errors.CheckError(fmt.Errorf("Missing KEYID argument")) + errors.CheckError(stderrors.New("Missing KEYID argument")) } conn, gpgIf := headless.NewClientOrDie(clientOpts, c).NewGPGKeyClientOrDie() defer argoio.Close(conn) @@ -136,7 +137,7 @@ func NewGPGAddCommand(clientOpts *argocdclient.ClientOptions) *cobra.Command { ctx := c.Context() if fromFile == "" { - errors.CheckError(fmt.Errorf("--from is mandatory")) + errors.CheckError(stderrors.New("--from is mandatory")) } keyData, err := os.ReadFile(fromFile) if err != nil { @@ -166,7 +167,7 @@ func NewGPGDeleteCommand(clientOpts *argocdclient.ClientOptions) *cobra.Command ctx := c.Context() if len(args) != 1 { - errors.CheckError(fmt.Errorf("Missing KEYID argument")) + errors.CheckError(stderrors.New("Missing KEYID argument")) } keyId := args[0] diff --git a/cmd/argocd/commands/repo.go b/cmd/argocd/commands/repo.go index 3aba1b2e65513..33a39fbb679c0 100644 --- a/cmd/argocd/commands/repo.go +++ b/cmd/argocd/commands/repo.go @@ -1,6 +1,7 @@ package commands import ( + stderrors "errors" "fmt" "os" "strconv" @@ -118,7 +119,7 @@ func NewRepoAddCommand(clientOpts *argocdclient.ClientOptions) *cobra.Command { } repoOpts.Repo.SSHPrivateKey = string(keyData) } else { - err := fmt.Errorf("--ssh-private-key-path is only supported for SSH repositories.") + err := stderrors.New("--ssh-private-key-path is only supported for SSH repositories.") errors.CheckError(err) } } @@ -126,7 +127,7 @@ func NewRepoAddCommand(clientOpts *argocdclient.ClientOptions) *cobra.Command { // tls-client-cert-path and tls-client-cert-key-key-path must always be // specified together if (repoOpts.TlsClientCertPath != "" && repoOpts.TlsClientCertKeyPath == "") || (repoOpts.TlsClientCertPath == "" && repoOpts.TlsClientCertKeyPath != "") { - err := fmt.Errorf("--tls-client-cert-path and --tls-client-cert-key-path must be specified together") + err := stderrors.New("--tls-client-cert-path and --tls-client-cert-key-path must be specified together") errors.CheckError(err) } @@ -140,7 +141,7 @@ func NewRepoAddCommand(clientOpts *argocdclient.ClientOptions) *cobra.Command { repoOpts.Repo.TLSClientCertData = string(tlsCertData) repoOpts.Repo.TLSClientCertKey = string(tlsCertKey) } else { - err := fmt.Errorf("--tls-client-cert-path is only supported for HTTPS repositories") + err := stderrors.New("--tls-client-cert-path is only supported for HTTPS repositories") errors.CheckError(err) } } @@ -152,7 +153,7 @@ func NewRepoAddCommand(clientOpts *argocdclient.ClientOptions) *cobra.Command { errors.CheckError(err) repoOpts.Repo.GithubAppPrivateKey = string(githubAppPrivateKey) } else { - err := fmt.Errorf("--github-app-private-key-path is only supported for HTTPS repositories") + err := stderrors.New("--github-app-private-key-path is only supported for HTTPS repositories") errors.CheckError(err) } } @@ -163,7 +164,7 @@ func NewRepoAddCommand(clientOpts *argocdclient.ClientOptions) *cobra.Command { errors.CheckError(err) repoOpts.Repo.GCPServiceAccountKey = string(gcpServiceAccountKey) } else { - err := fmt.Errorf("--gcp-service-account-key-path is only supported for HTTPS repositories") + err := stderrors.New("--gcp-service-account-key-path is only supported for HTTPS repositories") errors.CheckError(err) } } @@ -183,7 +184,7 @@ func NewRepoAddCommand(clientOpts *argocdclient.ClientOptions) *cobra.Command { repoOpts.Repo.ForceHttpBasicAuth = repoOpts.ForceHttpBasicAuth if repoOpts.Repo.Type == "helm" && repoOpts.Repo.Name == "" { - errors.CheckError(fmt.Errorf("Must specify --name for repos of type 'helm'")) + errors.CheckError(stderrors.New("Must specify --name for repos of type 'helm'")) } conn, repoIf := headless.NewClientOrDie(clientOpts, c).NewRepoClientOrDie() @@ -317,7 +318,7 @@ func NewRepoListCommand(clientOpts *argocdclient.ClientOptions) *cobra.Command { case "hard": forceRefresh = true default: - err := fmt.Errorf("--refresh must be one of: 'hard'") + err := stderrors.New("--refresh must be one of: 'hard'") errors.CheckError(err) } repos, err := repoIf.ListRepositories(ctx, &repositorypkg.RepoQuery{ForceRefresh: forceRefresh}) @@ -369,7 +370,7 @@ func NewRepoGetCommand(clientOpts *argocdclient.ClientOptions) *cobra.Command { case "hard": forceRefresh = true default: - err := fmt.Errorf("--refresh must be one of: 'hard'") + err := stderrors.New("--refresh must be one of: 'hard'") errors.CheckError(err) } repo, err := repoIf.Get(ctx, &repositorypkg.RepoQuery{Repo: repoURL, ForceRefresh: forceRefresh, AppProject: project}) diff --git a/cmd/argocd/commands/repocreds.go b/cmd/argocd/commands/repocreds.go index c25b0b2ab2e9b..1cc99bf872aee 100644 --- a/cmd/argocd/commands/repocreds.go +++ b/cmd/argocd/commands/repocreds.go @@ -1,6 +1,7 @@ package commands import ( + stderrors "errors" "fmt" "os" "text/tabwriter" @@ -104,7 +105,7 @@ func NewRepoCredsAddCommand(clientOpts *argocdclient.ClientOptions) *cobra.Comma } repo.SSHPrivateKey = string(keyData) } else { - err := fmt.Errorf("--ssh-private-key-path is only supported for SSH repositories.") + err := stderrors.New("--ssh-private-key-path is only supported for SSH repositories.") errors.CheckError(err) } } @@ -112,7 +113,7 @@ func NewRepoCredsAddCommand(clientOpts *argocdclient.ClientOptions) *cobra.Comma // tls-client-cert-path and tls-client-cert-key-key-path must always be // specified together if (tlsClientCertPath != "" && tlsClientCertKeyPath == "") || (tlsClientCertPath == "" && tlsClientCertKeyPath != "") { - err := fmt.Errorf("--tls-client-cert-path and --tls-client-cert-key-path must be specified together") + err := stderrors.New("--tls-client-cert-path and --tls-client-cert-key-path must be specified together") errors.CheckError(err) } @@ -126,7 +127,7 @@ func NewRepoCredsAddCommand(clientOpts *argocdclient.ClientOptions) *cobra.Comma repo.TLSClientCertData = string(tlsCertData) repo.TLSClientCertKey = string(tlsCertKey) } else { - err := fmt.Errorf("--tls-client-cert-path is only supported for HTTPS repositories") + err := stderrors.New("--tls-client-cert-path is only supported for HTTPS repositories") errors.CheckError(err) } } @@ -138,7 +139,7 @@ func NewRepoCredsAddCommand(clientOpts *argocdclient.ClientOptions) *cobra.Comma errors.CheckError(err) repo.GithubAppPrivateKey = string(githubAppPrivateKey) } else { - err := fmt.Errorf("--github-app-private-key-path is only supported for HTTPS repositories") + err := stderrors.New("--github-app-private-key-path is only supported for HTTPS repositories") errors.CheckError(err) } } @@ -150,7 +151,7 @@ func NewRepoCredsAddCommand(clientOpts *argocdclient.ClientOptions) *cobra.Comma errors.CheckError(err) repo.GCPServiceAccountKey = string(gcpServiceAccountKey) } else { - err := fmt.Errorf("--gcp-service-account-key-path is only supported for HTTPS repositories") + err := stderrors.New("--gcp-service-account-key-path is only supported for HTTPS repositories") errors.CheckError(err) } } diff --git a/cmd/util/app.go b/cmd/util/app.go index e66c03f4e9374..0b297ee19c146 100644 --- a/cmd/util/app.go +++ b/cmd/util/app.go @@ -2,6 +2,7 @@ package util import ( "bufio" + stderrors "errors" "fmt" "io" "net/url" @@ -636,7 +637,7 @@ func constructAppsFromFileUrl(fileURL, appName string, labels, annotations, args app.Name = appName } if app.Name == "" { - return nil, fmt.Errorf("app.Name is empty. --name argument can be used to provide app.Name") + return nil, stderrors.New("app.Name is empty. --name argument can be used to provide app.Name") } mergeLabels(app, labels) @@ -895,10 +896,10 @@ func FilterResources(groupChanged bool, resources []*argoappv1.ResourceDiff, gro filteredObjects = append(filteredObjects, deepCopy) } if len(filteredObjects) == 0 { - return nil, fmt.Errorf("No matching resource found") + return nil, stderrors.New("No matching resource found") } if len(filteredObjects) > 1 && !all { - return nil, fmt.Errorf("Multiple resources match inputs. Use the --all flag to patch multiple resources") + return nil, stderrors.New("Multiple resources match inputs. Use the --all flag to patch multiple resources") } return filteredObjects, nil } diff --git a/cmd/util/cluster.go b/cmd/util/cluster.go index ab4e4816cf1d7..5cd59baa0ea9c 100644 --- a/cmd/util/cluster.go +++ b/cmd/util/cluster.go @@ -2,6 +2,7 @@ package util import ( "context" + stderrors "errors" "fmt" "os" "sort" @@ -131,7 +132,7 @@ func GetKubePublicEndpoint(client kubernetes.Interface) (string, error) { } kubeconfig, ok := clusterInfo.Data["kubeconfig"] if !ok { - return "", fmt.Errorf("cluster-info does not contain a public kubeconfig") + return "", stderrors.New("cluster-info does not contain a public kubeconfig") } // Parse Kubeconfig and get server address config := &clientcmdapiv1.Config{} @@ -140,7 +141,7 @@ func GetKubePublicEndpoint(client kubernetes.Interface) (string, error) { return "", fmt.Errorf("failed to parse cluster-info kubeconfig: %w", err) } if len(config.Clusters) == 0 { - return "", fmt.Errorf("cluster-info kubeconfig does not have any clusters") + return "", stderrors.New("cluster-info kubeconfig does not have any clusters") } return config.Clusters[0].Cluster.Server, nil diff --git a/cmpserver/plugin/config.go b/cmpserver/plugin/config.go index 949e212d9cf76..7b7f2ef6faa5f 100644 --- a/cmpserver/plugin/config.go +++ b/cmpserver/plugin/config.go @@ -1,6 +1,7 @@ package plugin import ( + "errors" "fmt" "strings" @@ -82,13 +83,13 @@ func ReadPluginConfig(filePath string) (*PluginConfig, error) { func ValidatePluginConfig(config PluginConfig) error { if config.Metadata.Name == "" { - return fmt.Errorf("invalid plugin configuration file. metadata.name should be non-empty.") + return errors.New("invalid plugin configuration file. metadata.name should be non-empty.") } if config.TypeMeta.Kind != ConfigManagementPluginKind { return fmt.Errorf("invalid plugin configuration file. kind should be %s, found %s", ConfigManagementPluginKind, config.TypeMeta.Kind) } if len(config.Spec.Generate.Command) == 0 { - return fmt.Errorf("invalid plugin configuration file. spec.generate command should be non-empty") + return errors.New("invalid plugin configuration file. spec.generate command should be non-empty") } // discovery field is optional as apps can now specify plugin names directly return nil diff --git a/cmpserver/plugin/plugin.go b/cmpserver/plugin/plugin.go index c708edf9a0e05..7eb61acf4cfbc 100644 --- a/cmpserver/plugin/plugin.go +++ b/cmpserver/plugin/plugin.go @@ -63,7 +63,7 @@ func (s *Service) Init(workDir string) error { func runCommand(ctx context.Context, command Command, path string, env []string) (string, error) { if len(command.Command) == 0 { - return "", fmt.Errorf("Command is empty") + return "", errors.New("Command is empty") } cmd := exec.CommandContext(ctx, command.Command[0], append(command.Command[1:], command.Args...)...) @@ -212,7 +212,7 @@ func (s *Service) generateManifestGeneric(stream GenerateManifestStream) error { appPath := filepath.Clean(filepath.Join(workDir, metadata.AppRelPath)) if !strings.HasPrefix(appPath, workDir) { - return fmt.Errorf("illegal appPath: out of workDir bound") + return errors.New("illegal appPath: out of workDir bound") } response, err := s.generateManifest(ctx, appPath, metadata.GetEnv()) if err != nil { @@ -384,7 +384,7 @@ func (s *Service) GetParametersAnnouncement(stream apiclient.ConfigManagementPlu } appPath := filepath.Clean(filepath.Join(workDir, metadata.AppRelPath)) if !strings.HasPrefix(appPath, workDir) { - return fmt.Errorf("illegal appPath: out of workDir bound") + return errors.New("illegal appPath: out of workDir bound") } repoResponse, err := getParametersAnnouncement(bufferedCtx, appPath, s.initConstants.PluginConfig.Spec.Parameters.Static, s.initConstants.PluginConfig.Spec.Parameters.Dynamic, metadata.GetEnv()) diff --git a/commitserver/commit/commit.go b/commitserver/commit/commit.go index 0a40b3a7d6042..52e7548b36341 100644 --- a/commitserver/commit/commit.go +++ b/commitserver/commit/commit.go @@ -2,6 +2,7 @@ package commit import ( "context" + "errors" "fmt" "os" "time" @@ -78,16 +79,16 @@ func (s *Service) CommitHydratedManifests(ctx context.Context, r *apiclient.Comm // the changes. It returns the output of the git commands and an error if one occurred. func (s *Service) handleCommitRequest(logCtx *log.Entry, r *apiclient.CommitHydratedManifestsRequest) (string, string, error) { if r.Repo == nil { - return "", "", fmt.Errorf("repo is required") + return "", "", errors.New("repo is required") } if r.Repo.Repo == "" { - return "", "", fmt.Errorf("repo URL is required") + return "", "", errors.New("repo URL is required") } if r.TargetBranch == "" { - return "", "", fmt.Errorf("target branch is required") + return "", "", errors.New("target branch is required") } if r.SyncBranch == "" { - return "", "", fmt.Errorf("sync branch is required") + return "", "", errors.New("sync branch is required") } logCtx = logCtx.WithField("repo", r.Repo.Repo) diff --git a/controller/appcontroller.go b/controller/appcontroller.go index a9c44facb6586..22d737f985e60 100644 --- a/controller/appcontroller.go +++ b/controller/appcontroller.go @@ -3,7 +3,7 @@ package controller import ( "context" "encoding/json" - goerrors "errors" + stderrors "errors" "fmt" "math" "math/rand" @@ -1728,7 +1728,7 @@ func (ctrl *ApplicationController) processAppRefreshQueueItem() (processNext boo comparisonLevel == CompareWithLatestForceResolve, localManifests, hasMultipleSources, false) ts.AddCheckpoint("compare_app_state_ms") - if goerrors.Is(err, CompareStateRepoError) { + if stderrors.Is(err, CompareStateRepoError) { logCtx.Warnf("Ignoring temporary failed attempt to compare app state against repo: %v", err) return // short circuit if git error is encountered } @@ -2162,7 +2162,7 @@ func (ctrl *ApplicationController) autoSync(app *appv1.Application, syncStatus * ts.AddCheckpoint("set_app_operation_ms") setOpTime := time.Since(start) if err != nil { - if goerrors.Is(err, argo.ErrAnotherOperationInProgress) { + if stderrors.Is(err, argo.ErrAnotherOperationInProgress) { // skipping auto-sync because another operation is in progress and was not noticed due to stale data in informer // it is safe to skip auto-sync because it is already running logCtx.Warnf("Failed to initiate auto-sync to %s: %v", desiredCommitSHA, err) diff --git a/controller/clusterinfoupdater_test.go b/controller/clusterinfoupdater_test.go index 6dc10d9db3e30..24b6ce6ca7c7f 100644 --- a/controller/clusterinfoupdater_test.go +++ b/controller/clusterinfoupdater_test.go @@ -41,7 +41,7 @@ func TestClusterSecretUpdater(t *testing.T) { }{ {nil, nil, v1alpha1.ConnectionStatusUnknown}, {&now, nil, v1alpha1.ConnectionStatusSuccessful}, - {&now, fmt.Errorf("sync failed"), v1alpha1.ConnectionStatusFailed}, + {&now, errors.New("sync failed"), v1alpha1.ConnectionStatusFailed}, } emptyArgoCDConfigMap := &v1.ConfigMap{ diff --git a/controller/sharding/sharding.go b/controller/sharding/sharding.go index e593547b00f8f..dbd2ec191552e 100644 --- a/controller/sharding/sharding.go +++ b/controller/sharding/sharding.go @@ -3,6 +3,7 @@ package sharding import ( "context" "encoding/json" + stderrors "errors" "fmt" "hash/fnv" "math" @@ -471,7 +472,7 @@ func GetClusterSharding(kubeClient kubernetes.Interface, settingsMgr *settings.S if appControllerDeployment != nil && appControllerDeployment.Spec.Replicas != nil { replicasCount = int(*appControllerDeployment.Spec.Replicas) } else { - return nil, fmt.Errorf("(dynamic cluster distribution) failed to get app controller deployment replica count") + return nil, stderrors.New("(dynamic cluster distribution) failed to get app controller deployment replica count") } } else { replicasCount = env.ParseNumFromEnv(common.EnvControllerReplicas, 0, 0, math.MaxInt32) diff --git a/controller/sharding/sharding_test.go b/controller/sharding/sharding_test.go index c332e869c2789..446844b64a33f 100644 --- a/controller/sharding/sharding_test.go +++ b/controller/sharding/sharding_test.go @@ -958,7 +958,7 @@ func TestGetClusterSharding(t *testing.T) { useDynamicSharding: true, expectedShard: 0, expectedReplicas: 1, - expectedErr: fmt.Errorf("(dynamic cluster distribution) failed to get app controller deployment: deployments.apps \"missing-deployment\" not found"), + expectedErr: errors.New("(dynamic cluster distribution) failed to get app controller deployment: deployments.apps \"missing-deployment\" not found"), }, } diff --git a/controller/state_test.go b/controller/state_test.go index 2efc51718f9ef..9a410992366f5 100644 --- a/controller/state_test.go +++ b/controller/state_test.go @@ -2,7 +2,7 @@ package controller import ( "encoding/json" - "fmt" + "errors" "os" "testing" "time" @@ -62,7 +62,7 @@ func TestCompareAppStateEmpty(t *testing.T) { // TestCompareAppStateRepoError tests the case when CompareAppState notices a repo error func TestCompareAppStateRepoError(t *testing.T) { app := newFakeApp() - ctrl := newFakeController(&fakeData{manifestResponses: make([]*apiclient.ManifestResponse, 3)}, fmt.Errorf("test repo error")) + ctrl := newFakeController(&fakeData{manifestResponses: make([]*apiclient.ManifestResponse, 3)}, errors.New("test repo error")) sources := make([]argoappv1.ApplicationSource, 0) sources = append(sources, app.Spec.GetSource()) revisions := make([]string, 0) diff --git a/controller/sync.go b/controller/sync.go index fc1aeb19246e5..13d31311a8a28 100644 --- a/controller/sync.go +++ b/controller/sync.go @@ -2,7 +2,7 @@ package controller import ( "context" - goerrors "errors" + stderrors "errors" "fmt" "os" "strconv" @@ -200,7 +200,7 @@ func (m *appStateManager) SyncAppState(app *v1alpha1.Application, state *v1alpha // ignore error if CompareStateRepoError, this shouldn't happen as noRevisionCache is true compareResult, err := m.CompareAppState(app, proj, revisions, sources, false, true, syncOp.Manifests, isMultiSourceRevision, rollback) - if err != nil && !goerrors.Is(err, CompareStateRepoError) { + if err != nil && !stderrors.Is(err, CompareStateRepoError) { state.Phase = common.OperationError state.Message = err.Error() return diff --git a/pkg/apiclient/apiclient.go b/pkg/apiclient/apiclient.go index b0c8f83bc6362..4aba674e2b329 100644 --- a/pkg/apiclient/apiclient.go +++ b/pkg/apiclient/apiclient.go @@ -558,7 +558,7 @@ func (c *client) tlsConfig() (*tls.Config, error) { if len(c.CertPEMData) > 0 { cp := tls_util.BestEffortSystemCertPool() if !cp.AppendCertsFromPEM(c.CertPEMData) { - return nil, fmt.Errorf("credentials: failed to append certificates") + return nil, errors.New("credentials: failed to append certificates") } tlsConfig.RootCAs = cp } diff --git a/pkg/apiclient/grpcproxy.go b/pkg/apiclient/grpcproxy.go index b426db178a2ac..9d3c849c992b3 100644 --- a/pkg/apiclient/grpcproxy.go +++ b/pkg/apiclient/grpcproxy.go @@ -121,7 +121,7 @@ func (c *client) startGRPCProxy() (*grpc.Server, net.Listener, error) { grpc.UnknownServiceHandler(func(srv interface{}, stream grpc.ServerStream) error { fullMethodName, ok := grpc.MethodFromServerStream(stream) if !ok { - return fmt.Errorf("Unable to get method name from stream context.") + return errors.New("Unable to get method name from stream context.") } msg := make([]byte, 0) err := stream.RecvMsg(&msg) diff --git a/pkg/apis/application/v1alpha1/types.go b/pkg/apis/application/v1alpha1/types.go index 2c57c60d58b19..8282ce5337d39 100644 --- a/pkg/apis/application/v1alpha1/types.go +++ b/pkg/apis/application/v1alpha1/types.go @@ -2,6 +2,7 @@ package v1alpha1 import ( "encoding/json" + "errors" "fmt" "maps" "math" @@ -2659,7 +2660,7 @@ func (w *SyncWindow) scheduleOffsetByTimeZone() time.Duration { // AddWindow adds a sync window with the given parameters to the AppProject func (s *AppProjectSpec) AddWindow(knd string, sch string, dur string, app []string, ns []string, cl []string, ms bool, timeZone string) error { if len(knd) == 0 || len(sch) == 0 || len(dur) == 0 { - return fmt.Errorf("cannot create window: require kind, schedule, duration and one or more of applications, namespaces and clusters") + return errors.New("cannot create window: require kind, schedule, duration and one or more of applications, namespaces and clusters") } window := &SyncWindow{ @@ -2866,7 +2867,7 @@ func (w SyncWindow) active(currentTime time.Time) (bool, error) { // Update updates a sync window's settings with the given parameter func (w *SyncWindow) Update(s string, d string, a []string, n []string, c []string, tz string) error { if len(s) == 0 && len(d) == 0 && len(a) == 0 && len(n) == 0 && len(c) == 0 { - return fmt.Errorf("cannot update: require one or more of schedule, duration, application, namespace, or cluster") + return errors.New("cannot update: require one or more of schedule, duration, application, namespace, or cluster") } if len(s) > 0 { diff --git a/reposerver/cache/cache.go b/reposerver/cache/cache.go index 1fa9eb1c0fe2d..269f056c618db 100644 --- a/reposerver/cache/cache.go +++ b/reposerver/cache/cache.go @@ -169,7 +169,7 @@ func helmIndexRefsKey(repo string) string { func (c *Cache) SetHelmIndex(repo string, indexData []byte) error { if indexData == nil { // Logged as warning upstream - return fmt.Errorf("helm index data is nil, skipping cache") + return errors.New("helm index data is nil, skipping cache") } return c.cache.SetItem( helmIndexRefsKey(repo), diff --git a/reposerver/gpgwatcher.go b/reposerver/gpgwatcher.go index 5b43d6a24ac76..d2fdcbb62ded3 100644 --- a/reposerver/gpgwatcher.go +++ b/reposerver/gpgwatcher.go @@ -1,6 +1,7 @@ package reposerver import ( + "errors" "fmt" "path" "time" @@ -86,5 +87,5 @@ func StartGPGWatcher(sourcePath string) error { return fmt.Errorf("failed to add a new source to the watcher: %w", err) } <-done - return fmt.Errorf("Abnormal termination of GPG watcher, refusing to continue.") + return errors.New("Abnormal termination of GPG watcher, refusing to continue.") } diff --git a/reposerver/repository/repository.go b/reposerver/repository/repository.go index 5efc3876d5475..1bbba4f27f1f1 100644 --- a/reposerver/repository/repository.go +++ b/reposerver/repository/repository.go @@ -497,7 +497,7 @@ func resolveReferencedSources(hasMultipleSources bool, source *v1alpha1.Applicat return nil, fmt.Errorf("source referenced %q, which is not one of the available sources (%s)", refVar, strings.Join(refKeys, ", ")) } if refSourceMapping.Chart != "" { - return nil, fmt.Errorf("source has a 'chart' field defined, but Helm charts are not yet not supported for 'ref' sources") + return nil, errors.New("source has a 'chart' field defined, but Helm charts are not yet not supported for 'ref' sources") } normalizedRepoURL := git.NormalizeGitURL(refSourceMapping.Repo.Repo) _, ok = repoRefs[normalizedRepoURL] @@ -743,7 +743,7 @@ func (s *Service) runManifestGenAsync(ctx context.Context, repoRoot, commitSHA, return } if refSourceMapping.Chart != "" { - ch.errCh <- fmt.Errorf("source has a 'chart' field defined, but Helm charts are not yet not supported for 'ref' sources") + ch.errCh <- errors.New("source has a 'chart' field defined, but Helm charts are not yet not supported for 'ref' sources") return } normalizedRepoURL := git.NormalizeGitURL(refSourceMapping.Repo.Repo) @@ -1494,7 +1494,7 @@ func GenerateManifests(ctx context.Context, appPath, repoRoot, revision string, targets = append(targets, unstructuredObj) return nil } - return fmt.Errorf("resource list item has unexpected type") + return errors.New("resource list item has unexpected type") }) if err != nil { return nil, err @@ -1960,7 +1960,7 @@ func getPluginParamEnvs(envVars []string, plugin *v1alpha1.ApplicationSourcePlug for i, v := range env { parsedVar, err := v1alpha1.NewEnvEntry(v) if err != nil { - return nil, fmt.Errorf("failed to parse env vars") + return nil, errors.New("failed to parse env vars") } parsedEnv[i] = parsedVar } diff --git a/reposerver/repository/repository_test.go b/reposerver/repository/repository_test.go index e15fc11903e78..10492971a1e73 100644 --- a/reposerver/repository/repository_test.go +++ b/reposerver/repository/repository_test.go @@ -3399,7 +3399,7 @@ func TestErrorGetGitDirectories(t *testing.T) { {name: "InvalidResolveRevision", fields: fields{service: func() *Service { s, _, _ := newServiceWithOpt(t, func(gitClient *gitmocks.Client, helmClient *helmmocks.Client, paths *iomocks.TempPaths) { gitClient.On("Checkout", mock.Anything, mock.Anything).Return("", nil) - gitClient.On("LsRemote", mock.Anything).Return("", fmt.Errorf("ah error")) + gitClient.On("LsRemote", mock.Anything).Return("", errors.New("ah error")) gitClient.On("Root").Return(root) paths.On("GetPath", mock.Anything).Return(".", nil) paths.On("GetPathIfExists", mock.Anything).Return(".", nil) @@ -3416,7 +3416,7 @@ func TestErrorGetGitDirectories(t *testing.T) { {name: "ErrorVerifyCommit", fields: fields{service: func() *Service { s, _, _ := newServiceWithOpt(t, func(gitClient *gitmocks.Client, helmClient *helmmocks.Client, paths *iomocks.TempPaths) { gitClient.On("Checkout", mock.Anything, mock.Anything).Return("", nil) - gitClient.On("LsRemote", mock.Anything).Return("", fmt.Errorf("ah error")) + gitClient.On("LsRemote", mock.Anything).Return("", errors.New("ah error")) gitClient.On("VerifyCommitSignature", mock.Anything).Return("", fmt.Errorf("revision %s is not signed", "sadfsadf")) gitClient.On("Root").Return(root) paths.On("GetPath", mock.Anything).Return(".", nil) @@ -3541,7 +3541,7 @@ func TestErrorGetGitFiles(t *testing.T) { {name: "InvalidResolveRevision", fields: fields{service: func() *Service { s, _, _ := newServiceWithOpt(t, func(gitClient *gitmocks.Client, helmClient *helmmocks.Client, paths *iomocks.TempPaths) { gitClient.On("Checkout", mock.Anything, mock.Anything).Return("", nil) - gitClient.On("LsRemote", mock.Anything).Return("", fmt.Errorf("ah error")) + gitClient.On("LsRemote", mock.Anything).Return("", errors.New("ah error")) gitClient.On("Root").Return(root) paths.On("GetPath", mock.Anything).Return(".", nil) paths.On("GetPathIfExists", mock.Anything).Return(".", nil) @@ -3644,7 +3644,7 @@ func TestErrorUpdateRevisionForPaths(t *testing.T) { {name: "InvalidResolveRevision", fields: fields{service: func() *Service { s, _, _ := newServiceWithOpt(t, func(gitClient *gitmocks.Client, helmClient *helmmocks.Client, paths *iomocks.TempPaths) { gitClient.On("Checkout", mock.Anything, mock.Anything).Return("", nil) - gitClient.On("LsRemote", mock.Anything).Return("", fmt.Errorf("ah error")) + gitClient.On("LsRemote", mock.Anything).Return("", errors.New("ah error")) gitClient.On("Root").Return(root) paths.On("GetPath", mock.Anything).Return(".", nil) paths.On("GetPathIfExists", mock.Anything).Return(".", nil) @@ -3663,7 +3663,7 @@ func TestErrorUpdateRevisionForPaths(t *testing.T) { s, _, _ := newServiceWithOpt(t, func(gitClient *gitmocks.Client, helmClient *helmmocks.Client, paths *iomocks.TempPaths) { gitClient.On("Checkout", mock.Anything, mock.Anything).Return("", nil) gitClient.On("LsRemote", "HEAD").Once().Return("632039659e542ed7de0c170a4fcc1c571b288fc0", nil) - gitClient.On("LsRemote", mock.Anything).Return("", fmt.Errorf("ah error")) + gitClient.On("LsRemote", mock.Anything).Return("", errors.New("ah error")) gitClient.On("Root").Return(root) paths.On("GetPath", mock.Anything).Return(".", nil) paths.On("GetPathIfExists", mock.Anything).Return(".", nil) @@ -4105,7 +4105,7 @@ func TestVerifyCommitSignature(t *testing.T) { t.Setenv("ARGOCD_GPG_ENABLED", "true") mockGitClient := &gitmocks.Client{} mockGitClient.On("VerifyCommitSignature", mock.Anything, mock.Anything, mock.Anything, mock.Anything). - Return("", fmt.Errorf("UNKNOWN signature: gpg: Unknown signature from ABCDEFGH")) + Return("", errors.New("UNKNOWN signature: gpg: Unknown signature from ABCDEFGH")) err := verifyCommitSignature(true, mockGitClient, "abcd1234", repo) assert.EqualError(t, err, "UNKNOWN signature: gpg: Unknown signature from ABCDEFGH") }) @@ -4114,7 +4114,7 @@ func TestVerifyCommitSignature(t *testing.T) { t.Setenv("ARGOCD_GPG_ENABLED", "true") mockGitClient := &gitmocks.Client{} mockGitClient.On("VerifyCommitSignature", mock.Anything, mock.Anything, mock.Anything, mock.Anything). - Return("", fmt.Errorf("error verifying signature of commit 'abcd1234' in repo 'https://github.com/example/repo.git': failed to verify signature")) + Return("", errors.New("error verifying signature of commit 'abcd1234' in repo 'https://github.com/example/repo.git': failed to verify signature")) err := verifyCommitSignature(true, mockGitClient, "abcd1234", repo) assert.EqualError(t, err, "error verifying signature of commit 'abcd1234' in repo 'https://github.com/example/repo.git': failed to verify signature") }) diff --git a/server/application/application.go b/server/application/application.go index 7ffbca4f886d2..645071839a928 100644 --- a/server/application/application.go +++ b/server/application/application.go @@ -313,7 +313,7 @@ func (s *Server) List(ctx context.Context, q *application.ApplicationQuery) (*ap // Create creates an application func (s *Server) Create(ctx context.Context, q *application.ApplicationCreateRequest) (*appv1.Application, error) { if q.GetApplication() == nil { - return nil, fmt.Errorf("error creating application: application is nil in request") + return nil, errors.New("error creating application: application is nil in request") } a := q.GetApplication() @@ -441,7 +441,7 @@ func (s *Server) queryRepoServer(ctx context.Context, proj *appv1.AppProject, ac // GetManifests returns application manifests func (s *Server) GetManifests(ctx context.Context, q *application.ApplicationManifestQuery) (*apiclient.ManifestResponse, error) { if q.Name == nil || *q.Name == "" { - return nil, fmt.Errorf("invalid request: application name is missing") + return nil, errors.New("invalid request: application name is missing") } a, proj, err := s.getApplicationEnforceRBACInformer(ctx, rbacpolicy.ActionGet, q.GetProject(), q.GetAppNamespace(), q.GetName()) if err != nil { @@ -482,7 +482,7 @@ func (s *Server) GetManifests(ctx context.Context, q *application.ApplicationMan numOfSources := int64(len(a.Spec.GetSources())) for i, pos := range q.SourcePositions { if pos <= 0 || pos > numOfSources { - return fmt.Errorf("source position is out of range") + return errors.New("source position is out of range") } appSpec.Sources[pos-1].TargetRevision = q.Revisions[i] } @@ -588,7 +588,7 @@ func (s *Server) GetManifestsWithFiles(stream application.ApplicationService_Get } if query.Name == nil || *query.Name == "" { - return fmt.Errorf("invalid request: application name is missing") + return errors.New("invalid request: application name is missing") } a, proj, err := s.getApplicationEnforceRBACInformer(ctx, rbacpolicy.ActionGet, query.GetProject(), query.GetAppNamespace(), query.GetName()) @@ -798,7 +798,7 @@ func (s *Server) Get(ctx context.Context, q *application.ApplicationQuery) (*app for { select { case <-ctx.Done(): - return nil, fmt.Errorf("application refresh deadline exceeded") + return nil, errors.New("application refresh deadline exceeded") case event := <-events: if appVersion, err := strconv.Atoi(event.Application.ResourceVersion); err == nil && appVersion > minVersion { annotations := event.Application.GetAnnotations() @@ -968,7 +968,7 @@ func (s *Server) updateApp(app *appv1.Application, newApp *appv1.Application, ct // Update updates an application func (s *Server) Update(ctx context.Context, q *application.ApplicationUpdateRequest) (*appv1.Application, error) { if q.GetApplication() == nil { - return nil, fmt.Errorf("error updating application: application is nil in request") + return nil, errors.New("error updating application: application is nil in request") } a := q.GetApplication() if err := s.enf.EnforceErr(ctx.Value("claims"), rbacpolicy.ResourceApplications, rbacpolicy.ActionUpdate, a.RBACName(s.ns)); err != nil { @@ -985,7 +985,7 @@ func (s *Server) Update(ctx context.Context, q *application.ApplicationUpdateReq // UpdateSpec updates an application spec and filters out any invalid parameter overrides func (s *Server) UpdateSpec(ctx context.Context, q *application.ApplicationUpdateSpecRequest) (*appv1.ApplicationSpec, error) { if q.GetSpec() == nil { - return nil, fmt.Errorf("error updating application spec: spec is nil in request") + return nil, errors.New("error updating application spec: spec is nil in request") } a, _, err := s.getApplicationEnforceRBACClient(ctx, rbacpolicy.ActionUpdate, q.GetProject(), q.GetAppNamespace(), q.GetName(), "") if err != nil { @@ -1233,7 +1233,7 @@ func (s *Server) Watch(q *application.ApplicationQuery, ws application.Applicati func (s *Server) validateAndNormalizeApp(ctx context.Context, app *appv1.Application, proj *appv1.AppProject, validate bool) error { if app.GetName() == "" { - return fmt.Errorf("resource name may not be empty") + return errors.New("resource name may not be empty") } // ensure sources names are unique @@ -1440,7 +1440,7 @@ func (s *Server) PatchResource(ctx context.Context, q *application.ApplicationRe return nil, fmt.Errorf("error patching resource: %w", err) } if manifest == nil { - return nil, fmt.Errorf("failed to patch resource: manifest was nil") + return nil, errors.New("failed to patch resource: manifest was nil") } manifest, err = s.replaceSecretValues(manifest) if err != nil { @@ -2023,7 +2023,7 @@ func (s *Server) resolveSourceRevisions(ctx context.Context, a *appv1.Applicatio sources := a.Spec.GetSources() for i, pos := range syncReq.SourcePositions { if pos <= 0 || pos > numOfSources { - return "", "", nil, nil, fmt.Errorf("source position is out of range") + return "", "", nil, nil, errors.New("source position is out of range") } sources[pos-1].TargetRevision = syncReq.Revisions[i] } @@ -2176,7 +2176,7 @@ func (s *Server) getObjectsForDeepLinks(ctx context.Context, app *appv1.Applicat return nil, nil, err } if !permitted { - return nil, nil, fmt.Errorf("error getting destination cluster") + return nil, nil, errors.New("error getting destination cluster") } clst, err := s.db.GetCluster(ctx, app.Spec.Destination.Server) if err != nil { diff --git a/server/application/application_test.go b/server/application/application_test.go index 3b1a4fce27a54..f796937649013 100644 --- a/server/application/application_test.go +++ b/server/application/application_test.go @@ -2,7 +2,7 @@ package application import ( "context" - coreerrors "errors" + stderrors "errors" "fmt" "io" "strconv" @@ -2066,7 +2066,7 @@ func TestGetCachedAppState(t *testing.T) { }) t.Run("NonCacheErrorDoesNotTriggerRefresh", func(t *testing.T) { - randomError := coreerrors.New("random error") + randomError := stderrors.New("random error") err := appServer.getCachedAppState(context.Background(), testApp, func() error { return randomError }) diff --git a/server/applicationset/applicationset.go b/server/applicationset/applicationset.go index b5288c71c1509..9807c515bc0ab 100644 --- a/server/applicationset/applicationset.go +++ b/server/applicationset/applicationset.go @@ -3,6 +3,7 @@ package applicationset import ( "bytes" "context" + "errors" "fmt" "reflect" "sort" @@ -184,7 +185,7 @@ func (s *Server) Create(ctx context.Context, q *applicationset.ApplicationSetCre appset := q.GetApplicationset() if appset == nil { - return nil, fmt.Errorf("error creating ApplicationSets: ApplicationSets is nil in request") + return nil, errors.New("error creating ApplicationSets: ApplicationSets is nil in request") } projectName, err := s.validateAppSet(appset) @@ -370,7 +371,7 @@ func (s *Server) Generate(ctx context.Context, q *applicationset.ApplicationSetG appset := q.GetApplicationSet() if appset == nil { - return nil, fmt.Errorf("error creating ApplicationSets: ApplicationSets is nil in request") + return nil, errors.New("error creating ApplicationSets: ApplicationSets is nil in request") } namespace := s.appsetNamespaceOrDefault(appset.Namespace) @@ -429,13 +430,13 @@ func (s *Server) buildApplicationSetTree(a *v1alpha1.ApplicationSet) (*v1alpha1. func (s *Server) validateAppSet(appset *v1alpha1.ApplicationSet) (string, error) { if appset == nil { - return "", fmt.Errorf("ApplicationSet cannot be validated for nil value") + return "", errors.New("ApplicationSet cannot be validated for nil value") } projectName := appset.Spec.Template.Spec.Project if strings.Contains(projectName, "{{") { - return "", fmt.Errorf("the Argo CD API does not currently support creating ApplicationSets with templated `project` fields") + return "", errors.New("the Argo CD API does not currently support creating ApplicationSets with templated `project` fields") } if err := appsetutils.CheckInvalidGenerators(appset); err != nil { diff --git a/server/extension/extension.go b/server/extension/extension.go index f7506692d7ebb..cba62c3bb591c 100644 --- a/server/extension/extension.go +++ b/server/extension/extension.go @@ -411,7 +411,7 @@ func proxyKey(extName, cName, cServer string) ProxyKey { func parseAndValidateConfig(s *settings.ArgoCDSettings) (*ExtensionConfigs, error) { if len(s.ExtensionConfig) == 0 { - return nil, fmt.Errorf("no extensions configurations found") + return nil, errors.New("no extensions configurations found") } configs := ExtensionConfigs{} @@ -461,10 +461,10 @@ func validateConfigs(configs *ExtensionConfigs) error { exts := make(map[string]struct{}) for _, ext := range configs.Extensions { if ext.Name == "" { - return fmt.Errorf("extensions.name must be configured") + return errors.New("extensions.name must be configured") } if !nameSafeRegex.MatchString(ext.Name) { - return fmt.Errorf("invalid extensions.name: only alphanumeric characters, hyphens, and underscores are allowed") + return errors.New("invalid extensions.name: only alphanumeric characters, hyphens, and underscores are allowed") } if _, found := exts[ext.Name]; found { return fmt.Errorf("duplicated extension found in the configs for %q", ext.Name) @@ -476,23 +476,23 @@ func validateConfigs(configs *ExtensionConfigs) error { } for _, svc := range ext.Backend.Services { if svc.URL == "" { - return fmt.Errorf("extensions.backend.services.url must be configured") + return errors.New("extensions.backend.services.url must be configured") } if svcTotal > 1 && svc.Cluster == nil { - return fmt.Errorf("extensions.backend.services.cluster must be configured when defining more than one service per extension") + return errors.New("extensions.backend.services.cluster must be configured when defining more than one service per extension") } if svc.Cluster != nil { if svc.Cluster.Name == "" && svc.Cluster.Server == "" { - return fmt.Errorf("cluster.name or cluster.server must be defined when cluster is provided in the configuration") + return errors.New("cluster.name or cluster.server must be defined when cluster is provided in the configuration") } } if len(svc.Headers) > 0 { for _, header := range svc.Headers { if header.Name == "" { - return fmt.Errorf("header.name must be defined when providing service headers in the configuration") + return errors.New("header.name must be defined when providing service headers in the configuration") } if header.Value == "" { - return fmt.Errorf("header.value must be defined when providing service headers in the configuration") + return errors.New("header.value must be defined when providing service headers in the configuration") } } } @@ -654,7 +654,7 @@ func appendProxy(registry ProxyRegistry, // If all validations are satified it will return the Application resource func (m *Manager) authorize(ctx context.Context, rr *RequestResources, extName string) (*v1alpha1.Application, error) { if m.rbac == nil { - return nil, fmt.Errorf("rbac enforcer not set in extension manager") + return nil, errors.New("rbac enforcer not set in extension manager") } appRBACName := security.RBACName(rr.ApplicationNamespace, rr.ProjectName, rr.ApplicationNamespace, rr.ApplicationName) if err := m.rbac.EnforceErr(ctx.Value("claims"), rbacpolicy.ResourceApplications, rbacpolicy.ActionGet, appRBACName); err != nil { @@ -690,7 +690,7 @@ func (m *Manager) authorize(ctx context.Context, rr *RequestResources, extName s return nil, fmt.Errorf("error validating project destinations: %w", err) } if !permitted { - return nil, fmt.Errorf("the provided project is not allowed to access the cluster configured in the Application destination") + return nil, errors.New("the provided project is not allowed to access the cluster configured in the Application destination") } return app, nil diff --git a/server/gpgkey/gpgkey.go b/server/gpgkey/gpgkey.go index 338f3a8acc2c9..2332b6052f791 100644 --- a/server/gpgkey/gpgkey.go +++ b/server/gpgkey/gpgkey.go @@ -2,6 +2,7 @@ package gpgkey import ( "context" + "errors" "fmt" "strings" @@ -60,7 +61,7 @@ func (s *Server) Get(ctx context.Context, q *gpgkeypkg.GnuPGPublicKeyQuery) (*ap keyID := gpg.KeyID(q.KeyID) if keyID == "" { - return nil, fmt.Errorf("KeyID is malformed or empty") + return nil, errors.New("KeyID is malformed or empty") } keys, err := s.db.ListConfiguredGPGPublicKeys(ctx) @@ -83,7 +84,7 @@ func (s *Server) Create(ctx context.Context, q *gpgkeypkg.GnuPGPublicKeyCreateRe keyData := strings.TrimSpace(q.Publickey.KeyData) if keyData == "" { - return nil, fmt.Errorf("Submitted key data is empty") + return nil, errors.New("Submitted key data is empty") } added, skipped, err := s.db.AddGPGPublicKey(ctx, q.Publickey.KeyData) diff --git a/test/e2e/deployment_test.go b/test/e2e/deployment_test.go index 49ae9ad402968..1e83a4494eebb 100644 --- a/test/e2e/deployment_test.go +++ b/test/e2e/deployment_test.go @@ -3,6 +3,7 @@ package e2e import ( "context" "encoding/json" + stderrors "errors" "fmt" "os" "testing" @@ -384,12 +385,12 @@ func extractKubeConfigValues() (string, string, error) { context, ok := config.Contexts[config.CurrentContext] if !ok || context == nil { - return "", "", fmt.Errorf("no context") + return "", "", stderrors.New("no context") } cluster, ok := config.Clusters[context.Cluster] if !ok || cluster == nil { - return "", "", fmt.Errorf("no cluster") + return "", "", stderrors.New("no cluster") } var kubeConfigDefault string @@ -407,7 +408,7 @@ func extractKubeConfigValues() (string, string, error) { } if kubeConfigDefault == "" { - return "", "", fmt.Errorf("unable to retrieve kube config path") + return "", "", stderrors.New("unable to retrieve kube config path") } } diff --git a/test/e2e/fixture/cluster/consequences.go b/test/e2e/fixture/cluster/consequences.go index 5e35f942cc9db..0dabfec8034ed 100644 --- a/test/e2e/fixture/cluster/consequences.go +++ b/test/e2e/fixture/cluster/consequences.go @@ -2,7 +2,7 @@ package cluster import ( "context" - "fmt" + "errors" clusterpkg "github.com/argoproj/argo-cd/v2/pkg/apiclient/cluster" "github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1" @@ -46,7 +46,7 @@ func (c *Consequences) get() (*v1alpha1.Cluster, error) { } } - return nil, fmt.Errorf("cluster not found") + return nil, errors.New("cluster not found") } func (c *Consequences) Given() *Context { diff --git a/test/e2e/fixture/fixture.go b/test/e2e/fixture/fixture.go index d26d2e73b7a35..cbcd0e5574688 100644 --- a/test/e2e/fixture/fixture.go +++ b/test/e2e/fixture/fixture.go @@ -3,7 +3,7 @@ package fixture import ( "bufio" "context" - goerrors "errors" + stderrors "errors" "fmt" "os" "path" @@ -218,7 +218,7 @@ func init() { } f, err := os.Open(rf) if err != nil { - if goerrors.Is(err, os.ErrNotExist) { + if stderrors.Is(err, os.ErrNotExist) { return } else { panic(fmt.Sprintf("Could not read record file %s: %v", rf, err)) diff --git a/test/e2e/fixture/repos/consequences.go b/test/e2e/fixture/repos/consequences.go index bb150b24ff367..c9684423114e3 100644 --- a/test/e2e/fixture/repos/consequences.go +++ b/test/e2e/fixture/repos/consequences.go @@ -2,7 +2,7 @@ package repos import ( "context" - "fmt" + "errors" repositorypkg "github.com/argoproj/argo-cd/v2/pkg/apiclient/repository" "github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1" @@ -46,7 +46,7 @@ func (c *Consequences) get() (*v1alpha1.Repository, error) { } } - return nil, fmt.Errorf("repo not found") + return nil, errors.New("repo not found") } func (c *Consequences) Given() *Context { diff --git a/util/app/discovery/discovery.go b/util/app/discovery/discovery.go index 9f477e3a35a23..544a294f8b88c 100644 --- a/util/app/discovery/discovery.go +++ b/util/app/discovery/discovery.go @@ -2,6 +2,7 @@ package discovery import ( "context" + "errors" "fmt" "os" "path/filepath" @@ -118,7 +119,7 @@ func DetectConfigManagementPlugin(ctx context.Context, appPath, repoPath, plugin } } if !connFound { - return nil, nil, fmt.Errorf("could not find plugin supporting the given repository") + return nil, nil, errors.New("could not find plugin supporting the given repository") } } return conn, cmpClient, nil diff --git a/util/argo/argo.go b/util/argo/argo.go index 23fac86c6bf0c..30eb59b8ef49b 100644 --- a/util/argo/argo.go +++ b/util/argo/argo.go @@ -3,6 +3,7 @@ package argo import ( "context" "encoding/json" + "errors" "fmt" "regexp" "sort" @@ -464,7 +465,7 @@ func GetRefSources(ctx context.Context, sources argoappv1.ApplicationSources, pr } refKey := "$" + source.Ref if _, ok := refKeys[refKey]; ok { - return nil, fmt.Errorf("invalid sources: multiple sources had the same `ref` key") + return nil, errors.New("invalid sources: multiple sources had the same `ref` key") } refKeys[refKey] = true } @@ -1016,7 +1017,7 @@ func getDestinationServer(ctx context.Context, db db.ArgoDB, clusterName string) func getDestinationServerName(ctx context.Context, db db.ArgoDB, server string) (string, error) { if db == nil { - return "", fmt.Errorf("there are no clusters registered in the database") + return "", errors.New("there are no clusters registered in the database") } cluster, err := db.GetCluster(ctx, server) diff --git a/util/argo/argo_test.go b/util/argo/argo_test.go index 76cb6c9fc7b21..db17a641f8745 100644 --- a/util/argo/argo_test.go +++ b/util/argo/argo_test.go @@ -833,7 +833,7 @@ func TestValidatePermissions(t *testing.T) { }, } db := &dbmocks.ArgoDB{} - db.On("GetCluster", context.Background(), spec.Destination.Server).Return(nil, fmt.Errorf("Unknown error occurred")) + db.On("GetCluster", context.Background(), spec.Destination.Server).Return(nil, errors.New("Unknown error occurred")) conditions, err := ValidatePermissions(context.Background(), &spec, &proj, db) require.NoError(t, err) assert.Len(t, conditions, 1) @@ -970,7 +970,7 @@ func TestValidateDestination(t *testing.T) { } db := &dbmocks.ArgoDB{} - db.On("GetClusterServersByName", context.Background(), mock.Anything).Return(nil, fmt.Errorf("an error occurred")) + db.On("GetClusterServersByName", context.Background(), mock.Anything).Return(nil, errors.New("an error occurred")) err := ValidateDestination(context.Background(), &dest, db) require.ErrorContains(t, err, "an error occurred") diff --git a/util/argo/diff/diff.go b/util/argo/diff/diff.go index ed0a4e943e32b..93f5ed39665a2 100644 --- a/util/argo/diff/diff.go +++ b/util/argo/diff/diff.go @@ -1,6 +1,7 @@ package diff import ( + "errors" "fmt" "github.com/go-logr/logr" @@ -340,7 +341,7 @@ func StateDiffs(lives, configs []*unstructured.Unstructured, diffConfig DiffConf func diffArrayCached(configArray []*unstructured.Unstructured, liveArray []*unstructured.Unstructured, cachedDiff []*v1alpha1.ResourceDiff, opts ...diff.Option) (*diff.DiffResultList, error) { numItems := len(configArray) if len(liveArray) != numItems { - return nil, fmt.Errorf("left and right arrays have mismatched lengths") + return nil, errors.New("left and right arrays have mismatched lengths") } diffByKey := map[kube.ResourceKey]*v1alpha1.ResourceDiff{} @@ -411,7 +412,7 @@ func (c *diffConfig) DiffFromCache(appName string) (bool, []*v1alpha1.ResourceDi // the diff. None of the attributes in the lives and targets params will be modified. func preDiffNormalize(lives, targets []*unstructured.Unstructured, diffConfig DiffConfig) (*NormalizationResult, error) { if diffConfig == nil { - return nil, fmt.Errorf("preDiffNormalize error: diffConfig can not be nil") + return nil, errors.New("preDiffNormalize error: diffConfig can not be nil") } err := diffConfig.Validate() if err != nil { diff --git a/util/argo/normalizers/diff_normalizer.go b/util/argo/normalizers/diff_normalizer.go index ec2982dbf9ac1..f728128053f6b 100644 --- a/util/argo/normalizers/diff_normalizer.go +++ b/util/argo/normalizers/diff_normalizer.go @@ -82,7 +82,7 @@ func (np *jqNormalizerPatch) Apply(data []byte) ([]byte, error) { iter := np.code.RunWithContext(ctx, dataJson) first, ok := iter.Next() if !ok { - return nil, fmt.Errorf("JQ patch did not return any data") + return nil, errors.New("JQ patch did not return any data") } if err, ok = first.(error); ok { if errors.Is(err, context.DeadlineExceeded) { @@ -92,7 +92,7 @@ func (np *jqNormalizerPatch) Apply(data []byte) ([]byte, error) { } _, ok = iter.Next() if ok { - return nil, fmt.Errorf("JQ patch returned multiple objects") + return nil, errors.New("JQ patch returned multiple objects") } patchedData, err := json.Marshal(first) @@ -184,7 +184,7 @@ func NewIgnoreNormalizer(ignore []v1alpha1.ResourceIgnoreDifferences, overrides // Normalize removes fields from supplied resource using json paths from matching items of specified resources ignored differences list func (n *ignoreNormalizer) Normalize(un *unstructured.Unstructured) error { if un == nil { - return fmt.Errorf("invalid argument: unstructured is nil") + return errors.New("invalid argument: unstructured is nil") } matched := make([]normalizerPatch, 0) for _, patch := range n.patches { diff --git a/util/argo/normalizers/diff_normalizer_test.go b/util/argo/normalizers/diff_normalizer_test.go index 8feb8b3467157..32d133d6e8385 100644 --- a/util/argo/normalizers/diff_normalizer_test.go +++ b/util/argo/normalizers/diff_normalizer_test.go @@ -2,7 +2,7 @@ package normalizers import ( "encoding/json" - "fmt" + "errors" "testing" "github.com/stretchr/testify/assert" @@ -250,7 +250,7 @@ func TestNormalizeExpectedErrorAreSilenced(t *testing.T) { _, err = jqPatch.Apply(deploymentData) assert.False(t, shouldLogError(err)) - assert.True(t, shouldLogError(fmt.Errorf("An error that should not be ignored"))) + assert.True(t, shouldLogError(errors.New("An error that should not be ignored"))) } func TestJqPathExpressionFailWithTimeout(t *testing.T) { diff --git a/util/argo/resource_tracking.go b/util/argo/resource_tracking.go index bd951ebb29d9c..f9f1c6ca83a5a 100644 --- a/util/argo/resource_tracking.go +++ b/util/argo/resource_tracking.go @@ -22,7 +22,7 @@ const ( ) var ( - WrongResourceTrackingFormat = fmt.Errorf("wrong resource tracking format, should be :/:/") + WrongResourceTrackingFormat = errors.New("wrong resource tracking format, should be :/:/") LabelMaxLength = 63 OkEndPattern = regexp.MustCompile("[a-zA-Z0-9]$") ) diff --git a/util/cache/cache.go b/util/cache/cache.go index fb1d20c5b723b..2e8d0ad0e4bbe 100644 --- a/util/cache/cache.go +++ b/util/cache/cache.go @@ -4,6 +4,7 @@ import ( "context" "crypto/tls" "crypto/x509" + "errors" "fmt" "math" "os" @@ -270,7 +271,7 @@ func (c *Cache) generateFullKey(key string) string { // Sets or deletes an item in cache func (c *Cache) SetItem(key string, item interface{}, opts *CacheActionOpts) error { if item == nil { - return fmt.Errorf("cannot set nil item in cache") + return errors.New("cannot set nil item in cache") } if opts == nil { opts = &CacheActionOpts{} diff --git a/util/cert/cert.go b/util/cert/cert.go index 4fe39299666a9..04cdadc37bfce 100644 --- a/util/cert/cert.go +++ b/util/cert/cert.go @@ -246,7 +246,7 @@ func IsValidSSHKnownHostsEntry(line string) bool { func TokenizeSSHKnownHostsEntry(knownHostsEntry string) (string, string, []byte, error) { knownHostsToken := strings.SplitN(knownHostsEntry, " ", 3) if len(knownHostsToken) != 3 { - return "", "", nil, fmt.Errorf("error while tokenizing input data") + return "", "", nil, errors.New("error while tokenizing input data") } return knownHostsToken[0], knownHostsToken[1], []byte(knownHostsToken[2]), nil } @@ -332,7 +332,7 @@ func GetCertificateForConnect(serverName string) ([]string, error) { } if len(certificates) == 0 { - return nil, fmt.Errorf("no certificates found in existing file") + return nil, errors.New("no certificates found in existing file") } return certificates, nil diff --git a/util/cli/cli.go b/util/cli/cli.go index 92f41d2bed779..1a6383d2e93ba 100644 --- a/util/cli/cli.go +++ b/util/cli/cli.go @@ -5,6 +5,7 @@ package cli import ( "bufio" "bytes" + stderrors "errors" "flag" "fmt" "os" @@ -276,7 +277,7 @@ func InteractiveEdit(filePattern string, data []byte, save func(input []byte) er updated, err := os.ReadFile(tempFile) errors.CheckError(err) if string(updated) == "" || string(updated) == string(data) { - errors.CheckError(fmt.Errorf("edit cancelled, no valid changes were saved")) + errors.CheckError(stderrors.New("edit cancelled, no valid changes were saved")) break } else { data = stripComments(updated) diff --git a/util/cmp/stream.go b/util/cmp/stream.go index d7f080004d6f4..f765e850da294 100644 --- a/util/cmp/stream.go +++ b/util/cmp/stream.go @@ -41,7 +41,7 @@ func ReceiveRepoStream(ctx context.Context, receiver StreamReceiver, destDir str return nil, fmt.Errorf("error receiving stream header: %w", err) } if header == nil || header.GetMetadata() == nil { - return nil, fmt.Errorf("error getting stream metadata: metadata is nil") + return nil, errors.New("error getting stream metadata: metadata is nil") } metadata := header.GetMetadata() @@ -186,7 +186,7 @@ func receiveFile(ctx context.Context, receiver StreamReceiver, checksum, dst str } f := req.GetFile() if f == nil { - return nil, fmt.Errorf("stream request file is nil") + return nil, errors.New("stream request file is nil") } _, err = file.Write(f.Chunk) if err != nil { @@ -198,7 +198,7 @@ func receiveFile(ctx context.Context, receiver StreamReceiver, checksum, dst str } } if hex.EncodeToString(hasher.Sum(nil)) != checksum { - return nil, fmt.Errorf("file checksum validation error") + return nil, errors.New("file checksum validation error") } _, err = file.Seek(0, io.SeekStart) diff --git a/util/cmp/stream_test.go b/util/cmp/stream_test.go index 393cf5d1679a2..1927edf64cd21 100644 --- a/util/cmp/stream_test.go +++ b/util/cmp/stream_test.go @@ -2,7 +2,7 @@ package cmp_test import ( "context" - "fmt" + "errors" "io" "os" "path/filepath" @@ -30,7 +30,7 @@ func (m *streamMock) Recv() (*pluginclient.AppStreamRequest, error) { case <-m.done: return nil, io.EOF case <-time.After(500 * time.Millisecond): - return nil, fmt.Errorf("timeout receiving message mock") + return nil, errors.New("timeout receiving message mock") } } diff --git a/util/db/certificate.go b/util/db/certificate.go index 3bedbc5e6f4ea..401094316cc41 100644 --- a/util/db/certificate.go +++ b/util/db/certificate.go @@ -2,6 +2,7 @@ package db import ( "context" + "errors" "fmt" "regexp" "strings" @@ -270,7 +271,7 @@ func (db *db) CreateRepoCertificate(ctx context.Context, certificates *appsv1.Re // We should have at least one valid PEM entry if len(pemData) == 0 { - return nil, fmt.Errorf("No valid PEM data received.") + return nil, errors.New("No valid PEM data received.") } // Make sure we have valid X509 certificates in the data diff --git a/util/db/gpgkeys.go b/util/db/gpgkeys.go index 8d17d20374640..ddb985101a6e7 100644 --- a/util/db/gpgkeys.go +++ b/util/db/gpgkeys.go @@ -2,6 +2,7 @@ package db import ( "context" + "errors" "fmt" "os" @@ -38,7 +39,7 @@ func validatePGPKey(keyData string) (*appsv1.GnuPGPublicKey, error) { // Each key/value pair in the config map must exactly contain one public key, with the (short) GPG key ID as key if len(parsed) != 1 { - return nil, fmt.Errorf("More than one key found in input data") + return nil, errors.New("More than one key found in input data") } var retKey *appsv1.GnuPGPublicKey = nil @@ -51,7 +52,7 @@ func validatePGPKey(keyData string) (*appsv1.GnuPGPublicKey, error) { retKey.KeyData = keyData return retKey, nil } else { - return nil, fmt.Errorf("Could not find the GPG key") + return nil, errors.New("Could not find the GPG key") } } diff --git a/util/dex/config.go b/util/dex/config.go index 1b2f0fd02dfae..480ca077dcb61 100644 --- a/util/dex/config.go +++ b/util/dex/config.go @@ -1,6 +1,7 @@ package dex import ( + "errors" "fmt" "os" @@ -113,12 +114,12 @@ func GenerateDexConfigYAML(argocdSettings *settings.ArgoCDSettings, disableTls b } connectors, ok := dexCfg["connectors"].([]interface{}) if !ok { - return nil, fmt.Errorf("malformed Dex configuration found") + return nil, errors.New("malformed Dex configuration found") } for i, connectorIf := range connectors { connector, ok := connectorIf.(map[string]interface{}) if !ok { - return nil, fmt.Errorf("malformed Dex configuration found") + return nil, errors.New("malformed Dex configuration found") } connectorType := connector["type"].(string) if !needsRedirectURI(connectorType) { @@ -126,7 +127,7 @@ func GenerateDexConfigYAML(argocdSettings *settings.ArgoCDSettings, disableTls b } connectorCfg, ok := connector["config"].(map[string]interface{}) if !ok { - return nil, fmt.Errorf("malformed Dex configuration found") + return nil, errors.New("malformed Dex configuration found") } connectorCfg["redirectURI"] = dexRedirectURL connector["config"] = connectorCfg diff --git a/util/dex/dex.go b/util/dex/dex.go index 5c417f73293cb..a24d2d18f54f5 100644 --- a/util/dex/dex.go +++ b/util/dex/dex.go @@ -4,7 +4,7 @@ import ( "bytes" "crypto/tls" "crypto/x509" - "fmt" + stderrors "errors" "io" "net/http" "net/http/httputil" @@ -47,7 +47,7 @@ func TLSConfig(tlsConfig *DexTLSConfig) *tls.Config { RootCAs: tlsConfig.RootCAs, VerifyPeerCertificate: func(rawCerts [][]byte, verifiedChains [][]*x509.Certificate) error { if !bytes.Equal(rawCerts[0], tlsConfig.Certificate) { - return fmt.Errorf("dex server certificate does not match") + return stderrors.New("dex server certificate does not match") } return nil }, diff --git a/util/git/client.go b/util/git/client.go index 76160204fcd71..f45be86bffde9 100644 --- a/util/git/client.go +++ b/util/git/client.go @@ -41,7 +41,7 @@ import ( "github.com/argoproj/argo-cd/v2/util/proxy" ) -var ErrInvalidRepoURL = fmt.Errorf("repo URL is invalid") +var ErrInvalidRepoURL = errors.New("repo URL is invalid") type RevisionMetadata struct { Author string @@ -784,7 +784,7 @@ func (m *nativeGitClient) VerifyCommitSignature(revision string) (string, error) out, err := m.runGnuPGWrapper("git-verify-wrapper.sh", revision) if err != nil { log.Errorf("error verifying commit signature: %v", err) - return "", fmt.Errorf("permission denied") + return "", errors.New("permission denied") } return out, nil } @@ -807,7 +807,7 @@ func (m *nativeGitClient) ChangedFiles(revision string, targetRevision string) ( } if !IsCommitSHA(revision) || !IsCommitSHA(targetRevision) { - return []string{}, fmt.Errorf("invalid revision provided, must be SHA") + return []string{}, errors.New("invalid revision provided, must be SHA") } out, err := m.runCmd("diff", "--name-only", fmt.Sprintf("%s..%s", revision, targetRevision)) diff --git a/util/gpg/gpg.go b/util/gpg/gpg.go index 4e402d645f1cb..5bfaf99e92921 100644 --- a/util/gpg/gpg.go +++ b/util/gpg/gpg.go @@ -3,6 +3,7 @@ package gpg import ( "bufio" "encoding/hex" + "errors" "fmt" "os" "os/exec" @@ -521,12 +522,12 @@ func GetInstalledPGPKeys(kids []string) ([]*appsv1.GnuPGPublicKey, error) { // Next line should be the key ID, no prefix if !scanner.Scan() { - return nil, fmt.Errorf("Invalid output from gpg, end of text after primary key") + return nil, errors.New("Invalid output from gpg, end of text after primary key") } token = keyIdMatch.FindStringSubmatch(scanner.Text()) if len(token) != 2 { - return nil, fmt.Errorf("Invalid output from gpg, no key ID for primary key") + return nil, errors.New("Invalid output from gpg, no key ID for primary key") } key.Fingerprint = token[1] @@ -539,11 +540,11 @@ func GetInstalledPGPKeys(kids []string) ([]*appsv1.GnuPGPublicKey, error) { // Next line should be UID if !scanner.Scan() { - return nil, fmt.Errorf("Invalid output from gpg, end of text after key ID") + return nil, errors.New("Invalid output from gpg, end of text after key ID") } if !strings.HasPrefix(scanner.Text(), "uid ") { - return nil, fmt.Errorf("Invalid output from gpg, no identity for primary key") + return nil, errors.New("Invalid output from gpg, no identity for primary key") } token = uidMatch.FindStringSubmatch(scanner.Text()) diff --git a/util/grpc/errors_test.go b/util/grpc/errors_test.go index 710a6c9ffcc72..5b9dddd8b41b7 100644 --- a/util/grpc/errors_test.go +++ b/util/grpc/errors_test.go @@ -51,7 +51,7 @@ func Test_kubeErrToGRPC(t *testing.T) { Group: "apps", Resource: "Deployment", } - return apierr.NewForbidden(gr, "some-app", fmt.Errorf("authentication error")) + return apierr.NewForbidden(gr, "some-app", errors.New("authentication error")) } newUnauthorizedError := func() error { return apierr.NewUnauthorized("unauthenticated") @@ -60,10 +60,10 @@ func Test_kubeErrToGRPC(t *testing.T) { { name: "will return standard error if not grpc status", givenErrFn: func() error { - return fmt.Errorf("standard error") + return errors.New("standard error") }, expectedErrFn: func() error { - return fmt.Errorf("standard error") + return errors.New("standard error") }, expectedGRPCStatus: nil, }, diff --git a/util/healthz/healthz_test.go b/util/healthz/healthz_test.go index cf68eb419b708..d2724686dde1e 100644 --- a/util/healthz/healthz_test.go +++ b/util/healthz/healthz_test.go @@ -1,7 +1,7 @@ package healthz import ( - "fmt" + "errors" "net" "net/http" "testing" @@ -25,7 +25,7 @@ func TestHealthCheck(t *testing.T) { mux := http.NewServeMux() ServeHealthCheck(mux, func(r *http.Request) error { if sentinel { - return fmt.Errorf("This is a dummy error") + return errors.New("This is a dummy error") } return nil }) diff --git a/util/helm/index.go b/util/helm/index.go index 2dca5041d40dd..43e89653a8207 100644 --- a/util/helm/index.go +++ b/util/helm/index.go @@ -47,7 +47,7 @@ func (e Entries) MaxVersion(constraints *semver.Constraints) (*semver.Version, e } } if len(versions) == 0 { - return nil, fmt.Errorf("constraint not found in index") + return nil, errors.New("constraint not found in index") } maxVersion := versions[0] for _, v := range versions { diff --git a/util/io/path/resolved.go b/util/io/path/resolved.go index 4ac5831c54011..94ce9288db48e 100644 --- a/util/io/path/resolved.go +++ b/util/io/path/resolved.go @@ -35,7 +35,7 @@ func resolveSymbolicLinkRecursive(path string, maxDepth int) (string, error) { } if maxDepth == 0 { - return "", fmt.Errorf("maximum nesting level reached") + return "", errors.New("maximum nesting level reached") } // If we resolved to a relative symlink, make sure we use the absolute @@ -70,7 +70,7 @@ func isURLSchemeAllowed(scheme string, allowed []string) bool { // Instead, we log the concrete error details. func resolveFailure(path string, err error) error { log.Errorf("failed to resolve path '%s': %v", path, err) - return fmt.Errorf("internal error: failed to resolve path. Check logs for more details") + return errors.New("internal error: failed to resolve path. Check logs for more details") } func ResolveFileOrDirectoryPath(appPath, repoRoot, dir string) (ResolvedFileOrDirectoryPath, error) { @@ -176,7 +176,7 @@ func resolveFileOrDirectory(appPath string, repoRoot string, fileOrDirectory str resolvedToRoot := path+string(os.PathSeparator) == requiredRootPath if resolvedToRoot { if !allowResolveToRoot { - return "", resolveFailure(path, fmt.Errorf("path resolved to repository root, which is not allowed")) + return "", resolveFailure(path, errors.New("path resolved to repository root, which is not allowed")) } } else { // Make sure that the resolved path to file is within the repository's root path diff --git a/util/kustomize/kustomize.go b/util/kustomize/kustomize.go index 226a07a09c8de..1836aa1613ff8 100644 --- a/util/kustomize/kustomize.go +++ b/util/kustomize/kustomize.go @@ -1,6 +1,7 @@ package kustomize import ( + "errors" "fmt" "net/url" "os" @@ -304,7 +305,7 @@ func (k *kustomize) Build(opts *v1alpha1.ApplicationSourceKustomize, kustomizeOp // components only supported in kustomize >= v3.7.0 // https://github.com/kubernetes-sigs/kustomize/blob/master/examples/components.md if getSemverSafe().LessThan(semver.MustParse("v3.7.0")) { - return nil, nil, nil, fmt.Errorf("kustomize components require kustomize v3.7.0 and above") + return nil, nil, nil, errors.New("kustomize components require kustomize v3.7.0 and above") } // add components diff --git a/util/localconfig/localconfig.go b/util/localconfig/localconfig.go index 221695354ec7f..1a0685f753c49 100644 --- a/util/localconfig/localconfig.go +++ b/util/localconfig/localconfig.go @@ -1,6 +1,7 @@ package localconfig import ( + "errors" "fmt" "os" "path" @@ -131,7 +132,7 @@ func DeleteLocalConfig(configPath string) error { func (l *LocalConfig) ResolveContext(name string) (*Context, error) { if name == "" { if l.CurrentContext == "" { - return nil, fmt.Errorf("Local config: current-context unset") + return nil, errors.New("Local config: current-context unset") } name = l.CurrentContext } diff --git a/util/localconfig/localconfig_test.go b/util/localconfig/localconfig_test.go index ada30b865bd39..4c046752763f6 100644 --- a/util/localconfig/localconfig_test.go +++ b/util/localconfig/localconfig_test.go @@ -3,7 +3,7 @@ package localconfig import ( - "fmt" + "errors" "os" "path" "path/filepath" @@ -43,13 +43,13 @@ func TestFilePermission(t *testing.T) { name: "Test config file with permission 0700", testfile: ".config_0700", perm: 0o700, - expectedError: fmt.Errorf("config file has incorrect permission flags:-rwx------.change the file permission either to 0400 or 0600."), + expectedError: errors.New("config file has incorrect permission flags:-rwx------.change the file permission either to 0400 or 0600."), }, { name: "Test config file with permission 0777", testfile: ".config_0777", perm: 0o777, - expectedError: fmt.Errorf("config file has incorrect permission flags:-rwxrwxrwx.change the file permission either to 0400 or 0600."), + expectedError: errors.New("config file has incorrect permission flags:-rwxrwxrwx.change the file permission either to 0400 or 0600."), }, { name: "Test config file with permission 0600", @@ -67,7 +67,7 @@ func TestFilePermission(t *testing.T) { name: "Test config file with permission 0300", testfile: ".config_0300", perm: 0o300, - expectedError: fmt.Errorf("config file has incorrect permission flags:--wx------.change the file permission either to 0400 or 0600."), + expectedError: errors.New("config file has incorrect permission flags:--wx------.change the file permission either to 0400 or 0600."), }, } { t.Run(c.name, func(t *testing.T) { diff --git a/util/lua/lua.go b/util/lua/lua.go index 215d8041ac626..ed8067cc926a9 100644 --- a/util/lua/lua.go +++ b/util/lua/lua.go @@ -189,7 +189,7 @@ func (vm VM) ExecuteResourceAction(obj *unstructured.Unstructured, script string jsonString := bytes.NewBuffer(jsonBytes).String() if len(jsonString) < 2 { - return nil, fmt.Errorf("Lua output was not a valid json object or array") + return nil, errors.New("Lua output was not a valid json object or array") } // The output from Lua is either an object (old-style action output) or an array (new-style action output). // Check whether the string starts with an opening square bracket and ends with a closing square bracket, @@ -293,7 +293,7 @@ func cleanReturnedArray(newObj, obj []interface{}) []interface{} { func (vm VM) ExecuteResourceActionDiscovery(obj *unstructured.Unstructured, scripts []string) ([]appv1.ResourceAction, error) { if len(scripts) == 0 { - return nil, fmt.Errorf("no action discovery script provided") + return nil, errors.New("no action discovery script provided") } availableActionsMap := make(map[string]appv1.ResourceAction) diff --git a/util/manifeststream/stream.go b/util/manifeststream/stream.go index dd02f2570d975..c06fc410be822 100644 --- a/util/manifeststream/stream.go +++ b/util/manifeststream/stream.go @@ -45,7 +45,7 @@ func SendApplicationManifestQueryWithFiles(ctx context.Context, stream Applicati return fmt.Errorf("failed to compress files: %w", err) } if filesWritten == 0 { - return fmt.Errorf("no files to send") + return errors.New("no files to send") } err = stream.Send(&applicationpkg.ApplicationManifestQueryWithFilesWrapper{ @@ -107,7 +107,7 @@ func ReceiveApplicationManifestQueryWithFiles(stream ApplicationStreamReceiver) return nil, fmt.Errorf("failed to receive header: %w", err) } if header == nil || header.GetQuery() == nil { - return nil, fmt.Errorf("error getting stream query: query is nil") + return nil, errors.New("error getting stream query: query is nil") } return header.GetQuery(), nil } @@ -142,7 +142,7 @@ func SendRepoStream(repoStream RepoStreamSender, appStream ApplicationStreamRece return fmt.Errorf("stream Recv error: %w", err) } if part == nil || part.GetChunk() == nil { - return fmt.Errorf("error getting stream chunk: chunk is nil") + return errors.New("error getting stream chunk: chunk is nil") } err = repoStream.Send(&apiclient.ManifestRequestWithFiles{ @@ -166,7 +166,7 @@ func ReceiveManifestFileStream(ctx context.Context, receiver RepoStreamReceiver, return nil, nil, fmt.Errorf("failed to receive header: %w", err) } if header == nil || header.GetRequest() == nil { - return nil, nil, fmt.Errorf("error getting stream request: request is nil") + return nil, nil, errors.New("error getting stream request: request is nil") } request := header.GetRequest() @@ -175,7 +175,7 @@ func ReceiveManifestFileStream(ctx context.Context, receiver RepoStreamReceiver, return nil, nil, fmt.Errorf("failed to receive header: %w", err) } if header2 == nil || header2.GetMetadata() == nil { - return nil, nil, fmt.Errorf("error getting stream metadata: metadata is nil") + return nil, nil, errors.New("error getting stream metadata: metadata is nil") } metadata := header2.GetMetadata() @@ -223,7 +223,7 @@ func receiveFile(ctx context.Context, receiver RepoStreamReceiver, checksum stri } c := req.GetChunk() if c == nil { - return nil, fmt.Errorf("stream request chunk is nil") + return nil, errors.New("stream request chunk is nil") } size += len(c.Chunk) if size > int(maxSize) { diff --git a/util/manifeststream/stream_test.go b/util/manifeststream/stream_test.go index cbb32ed5e9fd5..a241328cce6ac 100644 --- a/util/manifeststream/stream_test.go +++ b/util/manifeststream/stream_test.go @@ -2,7 +2,7 @@ package manifeststream_test import ( "context" - "fmt" + "errors" "io" "math" "os" @@ -32,7 +32,7 @@ func (m *applicationStreamMock) Recv() (*applicationpkg.ApplicationManifestQuery case <-m.done: return nil, io.EOF case <-time.After(500 * time.Millisecond): - return nil, fmt.Errorf("timeout receiving message mock") + return nil, errors.New("timeout receiving message mock") } } @@ -62,7 +62,7 @@ func (m *repoStreamMock) Recv() (*apiclient.ManifestRequestWithFiles, error) { case <-m.done: return nil, io.EOF case <-time.After(500 * time.Millisecond): - return nil, fmt.Errorf("timeout receiving message mock") + return nil, errors.New("timeout receiving message mock") } } diff --git a/util/notification/settings/settings.go b/util/notification/settings/settings.go index 0e14dc60a7235..b274300873d76 100644 --- a/util/notification/settings/settings.go +++ b/util/notification/settings/settings.go @@ -1,7 +1,7 @@ package settings import ( - "fmt" + "errors" "github.com/argoproj/notifications-engine/pkg/api" "github.com/argoproj/notifications-engine/pkg/services" @@ -34,7 +34,7 @@ func GetFactorySettingsForCLI(argocdService *service.Service, secretName, config ConfigMapName: configMapName, InitGetVars: func(cfg *api.Config, configMap *v1.ConfigMap, secret *v1.Secret) (api.GetVars, error) { if *argocdService == nil { - return nil, fmt.Errorf("argocdService is not initialized") + return nil, errors.New("argocdService is not initialized") } if selfServiceNotificationEnabled { diff --git a/util/oidc/oidc.go b/util/oidc/oidc.go index 6b475d01c6a81..94f13b7d3e919 100644 --- a/util/oidc/oidc.go +++ b/util/oidc/oidc.go @@ -33,7 +33,7 @@ import ( "github.com/argoproj/argo-cd/v2/util/settings" ) -var InvalidRedirectURLError = fmt.Errorf("invalid return URL") +var InvalidRedirectURLError = errors.New("invalid return URL") const ( GrantTypeAuthorizationCode = "authorization_code" diff --git a/util/password/password.go b/util/password/password.go index 5544a4fc84635..4c277f70af9a8 100644 --- a/util/password/password.go +++ b/util/password/password.go @@ -2,7 +2,7 @@ package password import ( "crypto/subtle" - "fmt" + "errors" "golang.org/x/crypto/bcrypt" ) @@ -35,7 +35,7 @@ var preferredHashers = []PasswordHasher{ func hashPasswordWithHashers(password string, hashers []PasswordHasher) (string, error) { // Even though good hashers will disallow blank passwords, let's be explicit that ALL BLANK PASSWORDS ARE INVALID. Full stop. if password == "" { - return "", fmt.Errorf("blank passwords are not allowed") + return "", errors.New("blank passwords are not allowed") } return hashers[0].HashPassword(password) } diff --git a/util/session/sessionmanager.go b/util/session/sessionmanager.go index 09ba6aa43cd38..c04523d243e36 100644 --- a/util/session/sessionmanager.go +++ b/util/session/sessionmanager.go @@ -265,7 +265,7 @@ func (mgr *SessionManager) Parse(tokenString string) (jwt.Claims, string, error) } if account.PasswordMtime != nil && issuedAt.Before(*account.PasswordMtime) { - return nil, "", fmt.Errorf("account password has changed since token issued") + return nil, "", errors.New("account password has changed since token issued") } newToken := "" @@ -536,7 +536,7 @@ func (mgr *SessionManager) VerifyToken(tokenString string) (jwt.Claims, string, return nil, "", fmt.Errorf("cannot access settings while verifying the token: %w", err) } if argoSettings == nil { - return nil, "", fmt.Errorf("settings are not available while verifying the token") + return nil, "", errors.New("settings are not available while verifying the token") } idToken, err := prov.Verify(tokenString, argoSettings) @@ -573,7 +573,7 @@ func (mgr *SessionManager) provider() (oidcutil.Provider, error) { return nil, err } if !settings.IsSSOConfigured() { - return nil, fmt.Errorf("SSO is not configured") + return nil, errors.New("SSO is not configured") } mgr.prov = oidcutil.NewOIDCProvider(settings.IssuerURL(), mgr.client) return mgr.prov, nil diff --git a/util/settings/settings.go b/util/settings/settings.go index c9ec3573e1562..5ea3dcc0a6cc8 100644 --- a/util/settings/settings.go +++ b/util/settings/settings.go @@ -1431,7 +1431,7 @@ func (mgr *SettingsManager) initialize(ctx context.Context) error { }() if !cache.WaitForCacheSync(ctx.Done(), cmInformer.HasSynced, secretsInformer.HasSynced) { - return fmt.Errorf("Timed out waiting for settings cache to sync") + return errors.New("Timed out waiting for settings cache to sync") } log.Info("Configmap/secret informer synced") @@ -1586,7 +1586,7 @@ func validateExternalURL(u string) error { return fmt.Errorf("Failed to parse URL: %w", err) } if URL.Scheme != "http" && URL.Scheme != "https" { - return fmt.Errorf("URL must include http or https protocol") + return errors.New("URL must include http or https protocol") } return nil } diff --git a/util/tls/tls.go b/util/tls/tls.go index 819a8761afaed..e15ae4963fd8f 100644 --- a/util/tls/tls.go +++ b/util/tls/tls.go @@ -208,7 +208,7 @@ func pemBlockForKey(priv interface{}) *pem.Block { func generate(opts CertOptions) ([]byte, crypto.PrivateKey, error) { if len(opts.Hosts) == 0 { - return nil, nil, fmt.Errorf("hosts not supplied") + return nil, nil, errors.New("hosts not supplied") } var privateKey crypto.PrivateKey @@ -256,7 +256,7 @@ func generate(opts CertOptions) ([]byte, crypto.PrivateKey, error) { } if opts.Organization == "" { - return nil, nil, fmt.Errorf("organization not supplied") + return nil, nil, errors.New("organization not supplied") } template := x509.Certificate{ SerialNumber: serialNumber, @@ -366,7 +366,7 @@ func LoadX509Cert(path string) (*x509.Certificate, error) { } block, _ := pem.Decode(bytes) if block == nil { - return nil, fmt.Errorf("could not decode PEM") + return nil, errors.New("could not decode PEM") } cert, err := x509.ParseCertificate(block.Bytes) if err != nil { From 8bb2119a62db43e55ca17509d9310bd8833ff428 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 30 Dec 2024 11:02:58 +0200 Subject: [PATCH 8/8] [Bot] docs: Update Snyk reports (#21322) Signed-off-by: CI Co-authored-by: CI --- docs/snyk/master/argocd-iac-install.html | 2 +- docs/snyk/master/argocd-iac-namespace-install.html | 2 +- docs/snyk/master/argocd-test.html | 6 +++--- docs/snyk/master/ghcr.io_dexidp_dex_v2.41.1.html | 2 +- ...public.ecr.aws_docker_library_haproxy_2.6.17-alpine.html | 2 +- .../public.ecr.aws_docker_library_redis_7.0.15-alpine.html | 2 +- docs/snyk/master/quay.io_argoproj_argocd_latest.html | 6 +++--- docs/snyk/master/redis_7.0.15-alpine.html | 2 +- docs/snyk/v2.11.12/argocd-iac-install.html | 2 +- docs/snyk/v2.11.12/argocd-iac-namespace-install.html | 2 +- docs/snyk/v2.11.12/argocd-test.html | 2 +- docs/snyk/v2.11.12/ghcr.io_dexidp_dex_v2.38.0.html | 2 +- docs/snyk/v2.11.12/haproxy_2.6.14-alpine.html | 2 +- docs/snyk/v2.11.12/quay.io_argoproj_argocd_v2.11.12.html | 2 +- docs/snyk/v2.11.12/redis_7.0.15-alpine.html | 2 +- docs/snyk/v2.12.8/argocd-iac-install.html | 2 +- docs/snyk/v2.12.8/argocd-iac-namespace-install.html | 2 +- docs/snyk/v2.12.8/argocd-test.html | 2 +- docs/snyk/v2.12.8/ghcr.io_dexidp_dex_v2.38.0.html | 2 +- ...public.ecr.aws_docker_library_haproxy_2.6.17-alpine.html | 2 +- .../public.ecr.aws_docker_library_redis_7.0.15-alpine.html | 2 +- docs/snyk/v2.12.8/quay.io_argoproj_argocd_v2.12.8.html | 2 +- docs/snyk/v2.12.8/redis_7.0.15-alpine.html | 2 +- docs/snyk/v2.13.2/argocd-iac-install.html | 2 +- docs/snyk/v2.13.2/argocd-iac-namespace-install.html | 2 +- docs/snyk/v2.13.2/argocd-test.html | 2 +- docs/snyk/v2.13.2/ghcr.io_dexidp_dex_v2.41.1.html | 2 +- ...public.ecr.aws_docker_library_haproxy_2.6.17-alpine.html | 2 +- .../public.ecr.aws_docker_library_redis_7.0.15-alpine.html | 2 +- docs/snyk/v2.13.2/quay.io_argoproj_argocd_v2.13.2.html | 2 +- docs/snyk/v2.13.2/redis_7.0.15-alpine.html | 2 +- docs/snyk/v2.14.0-rc3/argocd-iac-install.html | 2 +- docs/snyk/v2.14.0-rc3/argocd-iac-namespace-install.html | 2 +- docs/snyk/v2.14.0-rc3/argocd-test.html | 2 +- docs/snyk/v2.14.0-rc3/ghcr.io_dexidp_dex_v2.41.1.html | 2 +- ...public.ecr.aws_docker_library_haproxy_2.6.17-alpine.html | 2 +- .../public.ecr.aws_docker_library_redis_7.0.15-alpine.html | 2 +- .../v2.14.0-rc3/quay.io_argoproj_argocd_v2.14.0-rc3.html | 2 +- docs/snyk/v2.14.0-rc3/redis_7.0.15-alpine.html | 2 +- 39 files changed, 43 insertions(+), 43 deletions(-) diff --git a/docs/snyk/master/argocd-iac-install.html b/docs/snyk/master/argocd-iac-install.html index 02056cedc3616..aa853964f37ff 100644 --- a/docs/snyk/master/argocd-iac-install.html +++ b/docs/snyk/master/argocd-iac-install.html @@ -456,7 +456,7 @@

Snyk test report

-

December 22nd 2024, 12:21:32 am (UTC+00:00)

+

December 29th 2024, 12:22:07 am (UTC+00:00)

Scanned the following path: diff --git a/docs/snyk/master/argocd-iac-namespace-install.html b/docs/snyk/master/argocd-iac-namespace-install.html index 15fb585d9abb1..d57dbb3d6c294 100644 --- a/docs/snyk/master/argocd-iac-namespace-install.html +++ b/docs/snyk/master/argocd-iac-namespace-install.html @@ -456,7 +456,7 @@

Snyk test report

-

December 22nd 2024, 12:21:41 am (UTC+00:00)

+

December 29th 2024, 12:22:17 am (UTC+00:00)

Scanned the following path: diff --git a/docs/snyk/master/argocd-test.html b/docs/snyk/master/argocd-test.html index b55cbe608b43c..7cc756cc31cdc 100644 --- a/docs/snyk/master/argocd-test.html +++ b/docs/snyk/master/argocd-test.html @@ -456,7 +456,7 @@

Snyk test report

-

December 22nd 2024, 12:19:28 am (UTC+00:00)

+

December 29th 2024, 12:19:49 am (UTC+00:00)

Scanned the following paths: @@ -1077,7 +1077,7 @@

MPL-2.0 license

  • Introduced through: - github.com/argoproj/argo-cd/v2@0.0.0 and github.com/gosimple/slug@1.14.0 + github.com/argoproj/argo-cd/v2@0.0.0 and github.com/gosimple/slug@1.15.0
  • @@ -1092,7 +1092,7 @@

    Detailed paths

    Introduced through: github.com/argoproj/argo-cd/v2@0.0.0 - github.com/gosimple/slug@1.14.0 + github.com/gosimple/slug@1.15.0 diff --git a/docs/snyk/master/ghcr.io_dexidp_dex_v2.41.1.html b/docs/snyk/master/ghcr.io_dexidp_dex_v2.41.1.html index 5e63b41d90ab5..713eca422e775 100644 --- a/docs/snyk/master/ghcr.io_dexidp_dex_v2.41.1.html +++ b/docs/snyk/master/ghcr.io_dexidp_dex_v2.41.1.html @@ -456,7 +456,7 @@

    Snyk test report

    -

    December 22nd 2024, 12:19:36 am (UTC+00:00)

    +

    December 29th 2024, 12:19:59 am (UTC+00:00)

    Scanned the following paths: diff --git a/docs/snyk/master/public.ecr.aws_docker_library_haproxy_2.6.17-alpine.html b/docs/snyk/master/public.ecr.aws_docker_library_haproxy_2.6.17-alpine.html index a77ff2be6395d..2d456122ca91a 100644 --- a/docs/snyk/master/public.ecr.aws_docker_library_haproxy_2.6.17-alpine.html +++ b/docs/snyk/master/public.ecr.aws_docker_library_haproxy_2.6.17-alpine.html @@ -456,7 +456,7 @@

    Snyk test report

    -

    December 22nd 2024, 12:19:40 am (UTC+00:00)

    +

    December 29th 2024, 12:20:04 am (UTC+00:00)

    Scanned the following path: diff --git a/docs/snyk/master/public.ecr.aws_docker_library_redis_7.0.15-alpine.html b/docs/snyk/master/public.ecr.aws_docker_library_redis_7.0.15-alpine.html index c6b67deeacea4..6cc380085f4c5 100644 --- a/docs/snyk/master/public.ecr.aws_docker_library_redis_7.0.15-alpine.html +++ b/docs/snyk/master/public.ecr.aws_docker_library_redis_7.0.15-alpine.html @@ -456,7 +456,7 @@

    Snyk test report

    -

    December 22nd 2024, 12:19:45 am (UTC+00:00)

    +

    December 29th 2024, 12:20:10 am (UTC+00:00)

    Scanned the following paths: diff --git a/docs/snyk/master/quay.io_argoproj_argocd_latest.html b/docs/snyk/master/quay.io_argoproj_argocd_latest.html index 93f0a6e561638..42171a8b4d685 100644 --- a/docs/snyk/master/quay.io_argoproj_argocd_latest.html +++ b/docs/snyk/master/quay.io_argoproj_argocd_latest.html @@ -456,7 +456,7 @@

    Snyk test report

    -

    December 22nd 2024, 12:20:03 am (UTC+00:00)

    +

    December 29th 2024, 12:20:31 am (UTC+00:00)

    Scanned the following paths: @@ -1631,7 +1631,7 @@

    MPL-2.0 license

  • Introduced through: - github.com/argoproj/argo-cd/v2@* and github.com/gosimple/slug@v1.14.0 + github.com/argoproj/argo-cd/v2@* and github.com/gosimple/slug@v1.15.0
  • @@ -1646,7 +1646,7 @@

    Detailed paths

    Introduced through: github.com/argoproj/argo-cd/v2@* - github.com/gosimple/slug@v1.14.0 + github.com/gosimple/slug@v1.15.0 diff --git a/docs/snyk/master/redis_7.0.15-alpine.html b/docs/snyk/master/redis_7.0.15-alpine.html index 06a95f0bdca0d..bfd4c58179882 100644 --- a/docs/snyk/master/redis_7.0.15-alpine.html +++ b/docs/snyk/master/redis_7.0.15-alpine.html @@ -456,7 +456,7 @@

    Snyk test report

    -

    December 22nd 2024, 12:20:08 am (UTC+00:00)

    +

    December 29th 2024, 12:20:35 am (UTC+00:00)

    Scanned the following paths: diff --git a/docs/snyk/v2.11.12/argocd-iac-install.html b/docs/snyk/v2.11.12/argocd-iac-install.html index c8313d79cdb86..7e92802a99ec8 100644 --- a/docs/snyk/v2.11.12/argocd-iac-install.html +++ b/docs/snyk/v2.11.12/argocd-iac-install.html @@ -456,7 +456,7 @@

    Snyk test report

    -

    December 22nd 2024, 12:30:57 am (UTC+00:00)

    +

    December 29th 2024, 12:32:09 am (UTC+00:00)

    Scanned the following path: diff --git a/docs/snyk/v2.11.12/argocd-iac-namespace-install.html b/docs/snyk/v2.11.12/argocd-iac-namespace-install.html index fae0b0aeee281..fbae0b8f1ad74 100644 --- a/docs/snyk/v2.11.12/argocd-iac-namespace-install.html +++ b/docs/snyk/v2.11.12/argocd-iac-namespace-install.html @@ -456,7 +456,7 @@

    Snyk test report

    -

    December 22nd 2024, 12:31:06 am (UTC+00:00)

    +

    December 29th 2024, 12:32:19 am (UTC+00:00)

    Scanned the following path: diff --git a/docs/snyk/v2.11.12/argocd-test.html b/docs/snyk/v2.11.12/argocd-test.html index cf1b2ca375827..12cee0b9d03d4 100644 --- a/docs/snyk/v2.11.12/argocd-test.html +++ b/docs/snyk/v2.11.12/argocd-test.html @@ -456,7 +456,7 @@

    Snyk test report

    -

    December 22nd 2024, 12:29:06 am (UTC+00:00)

    +

    December 29th 2024, 12:30:07 am (UTC+00:00)

    Scanned the following paths: diff --git a/docs/snyk/v2.11.12/ghcr.io_dexidp_dex_v2.38.0.html b/docs/snyk/v2.11.12/ghcr.io_dexidp_dex_v2.38.0.html index 9c1cb6cafa031..d6452532a8855 100644 --- a/docs/snyk/v2.11.12/ghcr.io_dexidp_dex_v2.38.0.html +++ b/docs/snyk/v2.11.12/ghcr.io_dexidp_dex_v2.38.0.html @@ -456,7 +456,7 @@

    Snyk test report

    -

    December 22nd 2024, 12:29:16 am (UTC+00:00)

    +

    December 29th 2024, 12:30:15 am (UTC+00:00)

    Scanned the following paths: diff --git a/docs/snyk/v2.11.12/haproxy_2.6.14-alpine.html b/docs/snyk/v2.11.12/haproxy_2.6.14-alpine.html index 8373a296875f7..baef06587e278 100644 --- a/docs/snyk/v2.11.12/haproxy_2.6.14-alpine.html +++ b/docs/snyk/v2.11.12/haproxy_2.6.14-alpine.html @@ -456,7 +456,7 @@

    Snyk test report

    -

    December 22nd 2024, 12:29:20 am (UTC+00:00)

    +

    December 29th 2024, 12:30:21 am (UTC+00:00)

    Scanned the following path: diff --git a/docs/snyk/v2.11.12/quay.io_argoproj_argocd_v2.11.12.html b/docs/snyk/v2.11.12/quay.io_argoproj_argocd_v2.11.12.html index 6d5f6d76bbced..f689807393f82 100644 --- a/docs/snyk/v2.11.12/quay.io_argoproj_argocd_v2.11.12.html +++ b/docs/snyk/v2.11.12/quay.io_argoproj_argocd_v2.11.12.html @@ -456,7 +456,7 @@

    Snyk test report

    -

    December 22nd 2024, 12:29:38 am (UTC+00:00)

    +

    December 29th 2024, 12:30:41 am (UTC+00:00)

    Scanned the following paths: diff --git a/docs/snyk/v2.11.12/redis_7.0.15-alpine.html b/docs/snyk/v2.11.12/redis_7.0.15-alpine.html index a0eb9c0f47aab..1311f1b315443 100644 --- a/docs/snyk/v2.11.12/redis_7.0.15-alpine.html +++ b/docs/snyk/v2.11.12/redis_7.0.15-alpine.html @@ -456,7 +456,7 @@

    Snyk test report

    -

    December 22nd 2024, 12:29:42 am (UTC+00:00)

    +

    December 29th 2024, 12:30:46 am (UTC+00:00)

    Scanned the following paths: diff --git a/docs/snyk/v2.12.8/argocd-iac-install.html b/docs/snyk/v2.12.8/argocd-iac-install.html index 02bc2c33d81f2..42727ea03911f 100644 --- a/docs/snyk/v2.12.8/argocd-iac-install.html +++ b/docs/snyk/v2.12.8/argocd-iac-install.html @@ -456,7 +456,7 @@

    Snyk test report

    -

    December 22nd 2024, 12:28:39 am (UTC+00:00)

    +

    December 29th 2024, 12:29:39 am (UTC+00:00)

    Scanned the following path: diff --git a/docs/snyk/v2.12.8/argocd-iac-namespace-install.html b/docs/snyk/v2.12.8/argocd-iac-namespace-install.html index ba810bf268d2f..ebf8158ad70ac 100644 --- a/docs/snyk/v2.12.8/argocd-iac-namespace-install.html +++ b/docs/snyk/v2.12.8/argocd-iac-namespace-install.html @@ -456,7 +456,7 @@

    Snyk test report

    -

    December 22nd 2024, 12:28:50 am (UTC+00:00)

    +

    December 29th 2024, 12:29:48 am (UTC+00:00)

    Scanned the following path: diff --git a/docs/snyk/v2.12.8/argocd-test.html b/docs/snyk/v2.12.8/argocd-test.html index b9b64d196d91b..d514945554a70 100644 --- a/docs/snyk/v2.12.8/argocd-test.html +++ b/docs/snyk/v2.12.8/argocd-test.html @@ -456,7 +456,7 @@

    Snyk test report

    -

    December 22nd 2024, 12:26:42 am (UTC+00:00)

    +

    December 29th 2024, 12:27:36 am (UTC+00:00)

    Scanned the following paths: diff --git a/docs/snyk/v2.12.8/ghcr.io_dexidp_dex_v2.38.0.html b/docs/snyk/v2.12.8/ghcr.io_dexidp_dex_v2.38.0.html index b94b788bcce58..4ac286e8a730e 100644 --- a/docs/snyk/v2.12.8/ghcr.io_dexidp_dex_v2.38.0.html +++ b/docs/snyk/v2.12.8/ghcr.io_dexidp_dex_v2.38.0.html @@ -456,7 +456,7 @@

    Snyk test report

    -

    December 22nd 2024, 12:26:52 am (UTC+00:00)

    +

    December 29th 2024, 12:27:44 am (UTC+00:00)

    Scanned the following paths: diff --git a/docs/snyk/v2.12.8/public.ecr.aws_docker_library_haproxy_2.6.17-alpine.html b/docs/snyk/v2.12.8/public.ecr.aws_docker_library_haproxy_2.6.17-alpine.html index f651ccc635624..66a00f577aec2 100644 --- a/docs/snyk/v2.12.8/public.ecr.aws_docker_library_haproxy_2.6.17-alpine.html +++ b/docs/snyk/v2.12.8/public.ecr.aws_docker_library_haproxy_2.6.17-alpine.html @@ -456,7 +456,7 @@

    Snyk test report

    -

    December 22nd 2024, 12:26:56 am (UTC+00:00)

    +

    December 29th 2024, 12:27:48 am (UTC+00:00)

    Scanned the following path: diff --git a/docs/snyk/v2.12.8/public.ecr.aws_docker_library_redis_7.0.15-alpine.html b/docs/snyk/v2.12.8/public.ecr.aws_docker_library_redis_7.0.15-alpine.html index d15e132034857..0e999d89a6aa9 100644 --- a/docs/snyk/v2.12.8/public.ecr.aws_docker_library_redis_7.0.15-alpine.html +++ b/docs/snyk/v2.12.8/public.ecr.aws_docker_library_redis_7.0.15-alpine.html @@ -456,7 +456,7 @@

    Snyk test report

    -

    December 22nd 2024, 12:27:00 am (UTC+00:00)

    +

    December 29th 2024, 12:27:52 am (UTC+00:00)

    Scanned the following paths: diff --git a/docs/snyk/v2.12.8/quay.io_argoproj_argocd_v2.12.8.html b/docs/snyk/v2.12.8/quay.io_argoproj_argocd_v2.12.8.html index 26084f119de2e..46f37d6589f92 100644 --- a/docs/snyk/v2.12.8/quay.io_argoproj_argocd_v2.12.8.html +++ b/docs/snyk/v2.12.8/quay.io_argoproj_argocd_v2.12.8.html @@ -456,7 +456,7 @@

    Snyk test report

    -

    December 22nd 2024, 12:27:19 am (UTC+00:00)

    +

    December 29th 2024, 12:28:14 am (UTC+00:00)

    Scanned the following paths: diff --git a/docs/snyk/v2.12.8/redis_7.0.15-alpine.html b/docs/snyk/v2.12.8/redis_7.0.15-alpine.html index fec28c7f4844b..c8db2d3e49563 100644 --- a/docs/snyk/v2.12.8/redis_7.0.15-alpine.html +++ b/docs/snyk/v2.12.8/redis_7.0.15-alpine.html @@ -456,7 +456,7 @@

    Snyk test report

    -

    December 22nd 2024, 12:27:23 am (UTC+00:00)

    +

    December 29th 2024, 12:28:19 am (UTC+00:00)

    Scanned the following paths: diff --git a/docs/snyk/v2.13.2/argocd-iac-install.html b/docs/snyk/v2.13.2/argocd-iac-install.html index 03df567ad1bbb..7634e62611150 100644 --- a/docs/snyk/v2.13.2/argocd-iac-install.html +++ b/docs/snyk/v2.13.2/argocd-iac-install.html @@ -456,7 +456,7 @@

    Snyk test report

    -

    December 22nd 2024, 12:26:13 am (UTC+00:00)

    +

    December 29th 2024, 12:27:07 am (UTC+00:00)

    Scanned the following path: diff --git a/docs/snyk/v2.13.2/argocd-iac-namespace-install.html b/docs/snyk/v2.13.2/argocd-iac-namespace-install.html index c27eaf9b5c33b..454a48e59e774 100644 --- a/docs/snyk/v2.13.2/argocd-iac-namespace-install.html +++ b/docs/snyk/v2.13.2/argocd-iac-namespace-install.html @@ -456,7 +456,7 @@

    Snyk test report

    -

    December 22nd 2024, 12:26:22 am (UTC+00:00)

    +

    December 29th 2024, 12:27:17 am (UTC+00:00)

    Scanned the following path: diff --git a/docs/snyk/v2.13.2/argocd-test.html b/docs/snyk/v2.13.2/argocd-test.html index e730af771b5fb..715b3f08940df 100644 --- a/docs/snyk/v2.13.2/argocd-test.html +++ b/docs/snyk/v2.13.2/argocd-test.html @@ -456,7 +456,7 @@

    Snyk test report

    -

    December 22nd 2024, 12:24:14 am (UTC+00:00)

    +

    December 29th 2024, 12:25:01 am (UTC+00:00)

    Scanned the following paths: diff --git a/docs/snyk/v2.13.2/ghcr.io_dexidp_dex_v2.41.1.html b/docs/snyk/v2.13.2/ghcr.io_dexidp_dex_v2.41.1.html index 8edc14c209863..95a99e4d9ac98 100644 --- a/docs/snyk/v2.13.2/ghcr.io_dexidp_dex_v2.41.1.html +++ b/docs/snyk/v2.13.2/ghcr.io_dexidp_dex_v2.41.1.html @@ -456,7 +456,7 @@

    Snyk test report

    -

    December 22nd 2024, 12:24:21 am (UTC+00:00)

    +

    December 29th 2024, 12:25:09 am (UTC+00:00)

    Scanned the following paths: diff --git a/docs/snyk/v2.13.2/public.ecr.aws_docker_library_haproxy_2.6.17-alpine.html b/docs/snyk/v2.13.2/public.ecr.aws_docker_library_haproxy_2.6.17-alpine.html index d63a46cdfc52e..ee6ba492d5fe2 100644 --- a/docs/snyk/v2.13.2/public.ecr.aws_docker_library_haproxy_2.6.17-alpine.html +++ b/docs/snyk/v2.13.2/public.ecr.aws_docker_library_haproxy_2.6.17-alpine.html @@ -456,7 +456,7 @@

    Snyk test report

    -

    December 22nd 2024, 12:24:25 am (UTC+00:00)

    +

    December 29th 2024, 12:25:13 am (UTC+00:00)

    Scanned the following path: diff --git a/docs/snyk/v2.13.2/public.ecr.aws_docker_library_redis_7.0.15-alpine.html b/docs/snyk/v2.13.2/public.ecr.aws_docker_library_redis_7.0.15-alpine.html index 3db1b9d0e21e7..9fb6e14241c9e 100644 --- a/docs/snyk/v2.13.2/public.ecr.aws_docker_library_redis_7.0.15-alpine.html +++ b/docs/snyk/v2.13.2/public.ecr.aws_docker_library_redis_7.0.15-alpine.html @@ -456,7 +456,7 @@

    Snyk test report

    -

    December 22nd 2024, 12:24:30 am (UTC+00:00)

    +

    December 29th 2024, 12:25:18 am (UTC+00:00)

    Scanned the following paths: diff --git a/docs/snyk/v2.13.2/quay.io_argoproj_argocd_v2.13.2.html b/docs/snyk/v2.13.2/quay.io_argoproj_argocd_v2.13.2.html index 3085226e26dc4..10a025ea00d8a 100644 --- a/docs/snyk/v2.13.2/quay.io_argoproj_argocd_v2.13.2.html +++ b/docs/snyk/v2.13.2/quay.io_argoproj_argocd_v2.13.2.html @@ -456,7 +456,7 @@

    Snyk test report

    -

    December 22nd 2024, 12:24:47 am (UTC+00:00)

    +

    December 29th 2024, 12:25:36 am (UTC+00:00)

    Scanned the following paths: diff --git a/docs/snyk/v2.13.2/redis_7.0.15-alpine.html b/docs/snyk/v2.13.2/redis_7.0.15-alpine.html index 524ab82125ed9..2cd5166fec159 100644 --- a/docs/snyk/v2.13.2/redis_7.0.15-alpine.html +++ b/docs/snyk/v2.13.2/redis_7.0.15-alpine.html @@ -456,7 +456,7 @@

    Snyk test report

    -

    December 22nd 2024, 12:24:51 am (UTC+00:00)

    +

    December 29th 2024, 12:25:40 am (UTC+00:00)

    Scanned the following paths: diff --git a/docs/snyk/v2.14.0-rc3/argocd-iac-install.html b/docs/snyk/v2.14.0-rc3/argocd-iac-install.html index f08c746fff497..5ed6c65a863a1 100644 --- a/docs/snyk/v2.14.0-rc3/argocd-iac-install.html +++ b/docs/snyk/v2.14.0-rc3/argocd-iac-install.html @@ -456,7 +456,7 @@

    Snyk test report

    -

    December 22nd 2024, 12:23:51 am (UTC+00:00)

    +

    December 29th 2024, 12:24:37 am (UTC+00:00)

    Scanned the following path: diff --git a/docs/snyk/v2.14.0-rc3/argocd-iac-namespace-install.html b/docs/snyk/v2.14.0-rc3/argocd-iac-namespace-install.html index c9f0c6cf38247..ee645440da339 100644 --- a/docs/snyk/v2.14.0-rc3/argocd-iac-namespace-install.html +++ b/docs/snyk/v2.14.0-rc3/argocd-iac-namespace-install.html @@ -456,7 +456,7 @@

    Snyk test report

    -

    December 22nd 2024, 12:24:01 am (UTC+00:00)

    +

    December 29th 2024, 12:24:47 am (UTC+00:00)

    Scanned the following path: diff --git a/docs/snyk/v2.14.0-rc3/argocd-test.html b/docs/snyk/v2.14.0-rc3/argocd-test.html index 236035b9be62f..6f9a4672ee9ed 100644 --- a/docs/snyk/v2.14.0-rc3/argocd-test.html +++ b/docs/snyk/v2.14.0-rc3/argocd-test.html @@ -456,7 +456,7 @@

    Snyk test report

    -

    December 22nd 2024, 12:21:52 am (UTC+00:00)

    +

    December 29th 2024, 12:22:28 am (UTC+00:00)

    Scanned the following paths: diff --git a/docs/snyk/v2.14.0-rc3/ghcr.io_dexidp_dex_v2.41.1.html b/docs/snyk/v2.14.0-rc3/ghcr.io_dexidp_dex_v2.41.1.html index ea7cdb961ccd3..3ea8477ce1fe2 100644 --- a/docs/snyk/v2.14.0-rc3/ghcr.io_dexidp_dex_v2.41.1.html +++ b/docs/snyk/v2.14.0-rc3/ghcr.io_dexidp_dex_v2.41.1.html @@ -456,7 +456,7 @@

    Snyk test report

    -

    December 22nd 2024, 12:21:57 am (UTC+00:00)

    +

    December 29th 2024, 12:22:34 am (UTC+00:00)

    Scanned the following paths: diff --git a/docs/snyk/v2.14.0-rc3/public.ecr.aws_docker_library_haproxy_2.6.17-alpine.html b/docs/snyk/v2.14.0-rc3/public.ecr.aws_docker_library_haproxy_2.6.17-alpine.html index 92d2db8bd5e79..80520a7e17571 100644 --- a/docs/snyk/v2.14.0-rc3/public.ecr.aws_docker_library_haproxy_2.6.17-alpine.html +++ b/docs/snyk/v2.14.0-rc3/public.ecr.aws_docker_library_haproxy_2.6.17-alpine.html @@ -456,7 +456,7 @@

    Snyk test report

    -

    December 22nd 2024, 12:22:01 am (UTC+00:00)

    +

    December 29th 2024, 12:22:39 am (UTC+00:00)

    Scanned the following path: diff --git a/docs/snyk/v2.14.0-rc3/public.ecr.aws_docker_library_redis_7.0.15-alpine.html b/docs/snyk/v2.14.0-rc3/public.ecr.aws_docker_library_redis_7.0.15-alpine.html index 520e1938e8ab1..132422f01abb0 100644 --- a/docs/snyk/v2.14.0-rc3/public.ecr.aws_docker_library_redis_7.0.15-alpine.html +++ b/docs/snyk/v2.14.0-rc3/public.ecr.aws_docker_library_redis_7.0.15-alpine.html @@ -456,7 +456,7 @@

    Snyk test report

    -

    December 22nd 2024, 12:22:04 am (UTC+00:00)

    +

    December 29th 2024, 12:22:43 am (UTC+00:00)

    Scanned the following paths: diff --git a/docs/snyk/v2.14.0-rc3/quay.io_argoproj_argocd_v2.14.0-rc3.html b/docs/snyk/v2.14.0-rc3/quay.io_argoproj_argocd_v2.14.0-rc3.html index e5d8f6a78c378..d79e4cab220bf 100644 --- a/docs/snyk/v2.14.0-rc3/quay.io_argoproj_argocd_v2.14.0-rc3.html +++ b/docs/snyk/v2.14.0-rc3/quay.io_argoproj_argocd_v2.14.0-rc3.html @@ -456,7 +456,7 @@

    Snyk test report

    -

    December 22nd 2024, 12:22:23 am (UTC+00:00)

    +

    December 29th 2024, 12:23:01 am (UTC+00:00)

    Scanned the following paths: diff --git a/docs/snyk/v2.14.0-rc3/redis_7.0.15-alpine.html b/docs/snyk/v2.14.0-rc3/redis_7.0.15-alpine.html index 5f02ab8dd2b16..48adfb0e0926f 100644 --- a/docs/snyk/v2.14.0-rc3/redis_7.0.15-alpine.html +++ b/docs/snyk/v2.14.0-rc3/redis_7.0.15-alpine.html @@ -456,7 +456,7 @@

    Snyk test report

    -

    December 22nd 2024, 12:22:27 am (UTC+00:00)

    +

    December 29th 2024, 12:23:06 am (UTC+00:00)

    Scanned the following paths: