diff --git a/go.mod b/go.mod index 56532646e..bd48a159f 100644 --- a/go.mod +++ b/go.mod @@ -8,15 +8,15 @@ require ( github.com/AlecAivazis/survey/v2 v2.3.7 github.com/Masterminds/semver/v3 v3.3.0 github.com/adrg/xdg v0.5.3 - github.com/aws/aws-sdk-go-v2 v1.32.4 - github.com/aws/aws-sdk-go-v2/config v1.28.4 - github.com/aws/aws-sdk-go-v2/credentials v1.17.45 - github.com/aws/aws-sdk-go-v2/service/ecr v1.36.5 - github.com/aws/aws-sdk-go-v2/service/sts v1.33.0 + github.com/aws/aws-sdk-go-v2 v1.32.6 + github.com/aws/aws-sdk-go-v2/config v1.28.6 + github.com/aws/aws-sdk-go-v2/credentials v1.17.47 + github.com/aws/aws-sdk-go-v2/service/ecr v1.36.7 + github.com/aws/aws-sdk-go-v2/service/sts v1.33.2 github.com/bacongobbler/browser v1.1.0 github.com/bombsimon/logrusr/v4 v4.1.0 github.com/coreos/go-oidc/v3 v3.11.0 - github.com/cyphar/filepath-securejoin v0.3.4 + github.com/cyphar/filepath-securejoin v0.3.5 github.com/evanphx/json-patch/v5 v5.9.0 github.com/expr-lang/expr v1.16.9 github.com/fatih/structtag v1.2.0 @@ -48,7 +48,7 @@ require ( golang.org/x/oauth2 v0.24.0 golang.org/x/sync v0.9.0 google.golang.org/api v0.206.0 - google.golang.org/grpc v1.68.0 + google.golang.org/grpc v1.68.1 google.golang.org/protobuf v1.35.2 gopkg.in/yaml.v3 v3.0.1 helm.sh/helm/v3 v3.16.3 @@ -60,7 +60,7 @@ require ( k8s.io/klog/v2 v2.130.1 k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 oras.land/oras-go v1.2.6 - sigs.k8s.io/controller-runtime v0.19.1 + sigs.k8s.io/controller-runtime v0.19.3 sigs.k8s.io/yaml v1.4.0 ) @@ -74,15 +74,15 @@ require ( github.com/Masterminds/sprig/v3 v3.3.0 // indirect github.com/Masterminds/squirrel v1.5.4 // indirect github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect - github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.19 // indirect - github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.23 // indirect - github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.23 // indirect + github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.21 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.25 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.25 // indirect github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.0 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.4 // indirect - github.com/aws/aws-sdk-go-v2/service/sso v1.24.5 // indirect - github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.4 // indirect - github.com/aws/smithy-go v1.22.0 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.1 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.6 // indirect + github.com/aws/aws-sdk-go-v2/service/sso v1.24.7 // indirect + github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.6 // indirect + github.com/aws/smithy-go v1.22.1 // indirect github.com/blang/semver/v4 v4.0.0 // indirect github.com/chai2010/gettext-go v1.0.2 // indirect github.com/containerd/errdefs v0.3.0 // indirect @@ -154,7 +154,6 @@ require ( github.com/docker/libtrust v0.0.0-20160708172513-aabc10ec26b7 // indirect github.com/emicklei/go-restful/v3 v3.11.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect - github.com/fsnotify/fsnotify v1.7.0 // indirect github.com/go-errors/errors v1.5.1 // indirect github.com/go-jose/go-jose/v4 v4.0.2 // indirect github.com/go-logr/logr v1.4.2 @@ -209,7 +208,7 @@ require ( go.opentelemetry.io/otel/metric v1.29.0 // indirect go.opentelemetry.io/otel/trace v1.29.0 // indirect golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 // indirect - golang.org/x/sys v0.27.0 // indirect + golang.org/x/sys v0.28.0 // indirect golang.org/x/term v0.26.0 // indirect golang.org/x/text v0.20.0 // indirect golang.org/x/time v0.8.0 // indirect diff --git a/go.sum b/go.sum index 4996830d2..6e765686c 100644 --- a/go.sum +++ b/go.sum @@ -49,34 +49,34 @@ github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPd github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 h1:DklsrG3dyBCFEj5IhUbnKptjxatkF07cF2ak3yi77so= github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= -github.com/aws/aws-sdk-go-v2 v1.32.4 h1:S13INUiTxgrPueTmrm5DZ+MiAo99zYzHEFh1UNkOxNE= -github.com/aws/aws-sdk-go-v2 v1.32.4/go.mod h1:2SK5n0a2karNTv5tbP1SjsX0uhttou00v/HpXKM1ZUo= -github.com/aws/aws-sdk-go-v2/config v1.28.4 h1:qgD0MKmkIzZR2DrAjWJcI9UkndjR+8f6sjUQvXh0mb0= -github.com/aws/aws-sdk-go-v2/config v1.28.4/go.mod h1:LgnWnNzHZw4MLplSyEGia0WgJ/kCGD86zGCjvNpehJs= -github.com/aws/aws-sdk-go-v2/credentials v1.17.45 h1:DUgm5lFso57E7150RBgu1JpVQoF8fAPretiDStIuVjg= -github.com/aws/aws-sdk-go-v2/credentials v1.17.45/go.mod h1:dnBpENcPC1ekZrGpSWspX+ZRGzhkvqngT2Qp5xBR1dY= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.19 h1:woXadbf0c7enQ2UGCi8gW/WuKmE0xIzxBF/eD94jMKQ= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.19/go.mod h1:zminj5ucw7w0r65bP6nhyOd3xL6veAUMc3ElGMoLVb4= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.23 h1:A2w6m6Tmr+BNXjDsr7M90zkWjsu4JXHwrzPg235STs4= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.23/go.mod h1:35EVp9wyeANdujZruvHiQUAo9E3vbhnIO1mTCAxMlY0= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.23 h1:pgYW9FCabt2M25MoHYCfMrVY2ghiiBKYWUVXfwZs+sU= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.23/go.mod h1:c48kLgzO19wAu3CPkDWC28JbaJ+hfQlsdl7I2+oqIbk= +github.com/aws/aws-sdk-go-v2 v1.32.6 h1:7BokKRgRPuGmKkFMhEg/jSul+tB9VvXhcViILtfG8b4= +github.com/aws/aws-sdk-go-v2 v1.32.6/go.mod h1:P5WJBrYqqbWVaOxgH0X/FYYD47/nooaPOZPlQdmiN2U= +github.com/aws/aws-sdk-go-v2/config v1.28.6 h1:D89IKtGrs/I3QXOLNTH93NJYtDhm8SYa9Q5CsPShmyo= +github.com/aws/aws-sdk-go-v2/config v1.28.6/go.mod h1:GDzxJ5wyyFSCoLkS+UhGB0dArhb9mI+Co4dHtoTxbko= +github.com/aws/aws-sdk-go-v2/credentials v1.17.47 h1:48bA+3/fCdi2yAwVt+3COvmatZ6jUDNkDTIsqDiMUdw= +github.com/aws/aws-sdk-go-v2/credentials v1.17.47/go.mod h1:+KdckOejLW3Ks3b0E3b5rHsr2f9yuORBum0WPnE5o5w= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.21 h1:AmoU1pziydclFT/xRV+xXE/Vb8fttJCLRPv8oAkprc0= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.21/go.mod h1:AjUdLYe4Tgs6kpH4Bv7uMZo7pottoyHMn4eTcIcneaY= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.25 h1:s/fF4+yDQDoElYhfIVvSNyeCydfbuTKzhxSXDXCPasU= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.25/go.mod h1:IgPfDv5jqFIzQSNbUEMoitNooSMXjRSDkhXv8jiROvU= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.25 h1:ZntTCl5EsYnhN/IygQEUugpdwbhdkom9uHcbCftiGgA= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.25/go.mod h1:DBdPrgeocww+CSl1C8cEV8PN1mHMBhuCDLpXezyvWkE= github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1 h1:VaRN3TlFdd6KxX1x3ILT5ynH6HvKgqdiXoTxAF4HQcQ= github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1/go.mod h1:FbtygfRFze9usAadmnGJNc8KsP346kEe+y2/oyhGAGc= -github.com/aws/aws-sdk-go-v2/service/ecr v1.36.5 h1:FMF/uaTcIdhvOwZXJfzpwanx2m4Dd6IcN4vDnAn7NAA= -github.com/aws/aws-sdk-go-v2/service/ecr v1.36.5/go.mod h1:xhf509Ba+rG5whtO7w46O0raVzu1Og3Aba80LSvHbbQ= -github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.0 h1:TToQNkvGguu209puTojY/ozlqy2d/SFNcoLIqTFi42g= -github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.0/go.mod h1:0jp+ltwkf+SwG2fm/PKo8t4y8pJSgOCO4D8Lz3k0aHQ= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.4 h1:tHxQi/XHPK0ctd/wdOw0t7Xrc2OxcRCnVzv8lwWPu0c= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.4/go.mod h1:4GQbF1vJzG60poZqWatZlhP31y8PGCCVTvIGPdaaYJ0= -github.com/aws/aws-sdk-go-v2/service/sso v1.24.5 h1:HJwZwRt2Z2Tdec+m+fPjvdmkq2s9Ra+VR0hjF7V2o40= -github.com/aws/aws-sdk-go-v2/service/sso v1.24.5/go.mod h1:wrMCEwjFPms+V86TCQQeOxQF/If4vT44FGIOFiMC2ck= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.4 h1:zcx9LiGWZ6i6pjdcoE9oXAB6mUdeyC36Ia/QEiIvYdg= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.4/go.mod h1:Tp/ly1cTjRLGBBmNccFumbZ8oqpZlpdhFf80SrRh4is= -github.com/aws/aws-sdk-go-v2/service/sts v1.33.0 h1:s7LRgBqhwLaxcocnAniBJp7gaAB+4I4vHzqUqjH18yc= -github.com/aws/aws-sdk-go-v2/service/sts v1.33.0/go.mod h1:9XEUty5v5UAsMiFOBJrNibZgwCeOma73jgGwwhgffa8= -github.com/aws/smithy-go v1.22.0 h1:uunKnWlcoL3zO7q+gG2Pk53joueEOsnNB28QdMsmiMM= -github.com/aws/smithy-go v1.22.0/go.mod h1:irrKGvNn1InZwb2d7fkIRNucdfwR8R+Ts3wxYa/cJHg= +github.com/aws/aws-sdk-go-v2/service/ecr v1.36.7 h1:R+5XKIJga2K9Dkj0/iQ6fD/MBGo02oxGGFTc512lK/Q= +github.com/aws/aws-sdk-go-v2/service/ecr v1.36.7/go.mod h1:fDPQV/6ONOQOjvtKhtypIy1wcGLcKYtoK/lvZ9fyDGQ= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.1 h1:iXtILhvDxB6kPvEXgsDhGaZCSC6LQET5ZHSdJozeI0Y= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.1/go.mod h1:9nu0fVANtYiAePIBh2/pFUSwtJ402hLnp854CNoDOeE= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.6 h1:50+XsN70RS7dwJ2CkVNXzj7U2L1HKP8nqTd3XWEXBN4= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.6/go.mod h1:WqgLmwY7so32kG01zD8CPTJWVWM+TzJoOVHwTg4aPug= +github.com/aws/aws-sdk-go-v2/service/sso v1.24.7 h1:rLnYAfXQ3YAccocshIH5mzNNwZBkBo+bP6EhIxak6Hw= +github.com/aws/aws-sdk-go-v2/service/sso v1.24.7/go.mod h1:ZHtuQJ6t9A/+YDuxOLnbryAmITtr8UysSny3qcyvJTc= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.6 h1:JnhTZR3PiYDNKlXy50/pNeix9aGMo6lLpXwJ1mw8MD4= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.6/go.mod h1:URronUEGfXZN1VpdktPSD1EkAL9mfrV+2F4sjH38qOY= +github.com/aws/aws-sdk-go-v2/service/sts v1.33.2 h1:s4074ZO1Hk8qv65GqNXqDjmkf4HSQqJukaLuuW0TpDA= +github.com/aws/aws-sdk-go-v2/service/sts v1.33.2/go.mod h1:mVggCnIWoM09jP71Wh+ea7+5gAp53q+49wDFs1SW5z8= +github.com/aws/smithy-go v1.22.1 h1:/HPHZQ0g7f4eUeK6HKglFz8uwVfZKgoI25rb/J+dnro= +github.com/aws/smithy-go v1.22.1/go.mod h1:irrKGvNn1InZwb2d7fkIRNucdfwR8R+Ts3wxYa/cJHg= github.com/bacongobbler/browser v1.1.0 h1:6YTctUlzcApit1vpWgh+myjh8lQUyQRD2Ltoyvy2EoM= github.com/bacongobbler/browser v1.1.0/go.mod h1:T9AaY4DSJ61FNgVTlCP/FWPrJ36TMRwI0Z18eLZ3IKI= github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A= @@ -124,8 +124,8 @@ github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ3 github.com/creack/pty v1.1.17/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4= github.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY= github.com/creack/pty v1.1.18/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4= -github.com/cyphar/filepath-securejoin v0.3.4 h1:VBWugsJh2ZxJmLFSM06/0qzQyiQX2Qs0ViKrUAcqdZ8= -github.com/cyphar/filepath-securejoin v0.3.4/go.mod h1:8s/MCNJREmFK0H02MF6Ihv1nakJe4L/w3WZLHNkvlYM= +github.com/cyphar/filepath-securejoin v0.3.5 h1:L81NHjquoQmcPgXcttUS9qTSR/+bXry6pbSINQGpjj4= +github.com/cyphar/filepath-securejoin v0.3.5/go.mod h1:edhVd3c6OXKjUmSrVa/tGJRS9joFTxlslFCAyaxigkE= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= @@ -178,8 +178,6 @@ github.com/foxcpp/go-mockdns v1.1.0 h1:jI0rD8M0wuYAxL7r/ynTrCQQq0BVqfB99Vgk7Dlme github.com/foxcpp/go-mockdns v1.1.0/go.mod h1:IhLeSFGed3mJIAXPH2aiRQB+kqz7oqu8ld2qVbOu7Wk= github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= -github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= -github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= github.com/fxamacker/cbor/v2 v2.7.0 h1:iM5WgngdRBanHcxugY4JySA0nk1wZorNOpTgCMedv5E= github.com/fxamacker/cbor/v2 v2.7.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ= github.com/go-errors/errors v1.5.1 h1:ZwEMSLRCapFLflTpT7NKaAc7ukJ8ZPEjzlxt8rPN8bk= @@ -636,8 +634,8 @@ golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220906165534-d0df966e6959/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= -golang.org/x/sys v0.27.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= +golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.26.0 h1:WEQa6V3Gja/BhNxg540hBip/kkaYtRg3cxg4oXSw4AU= @@ -684,8 +682,8 @@ google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyac google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= -google.golang.org/grpc v1.68.0 h1:aHQeeJbo8zAkAa3pRzrVjZlbz6uSfeOXlJNQM0RAbz0= -google.golang.org/grpc v1.68.0/go.mod h1:fmSPC5AsjSBCK54MyHRx48kpOti1/jRfOlwEWywNjWA= +google.golang.org/grpc v1.68.1 h1:oI5oTa11+ng8r8XMMN7jAOmWfPZWbYpCFaMUTACxkM0= +google.golang.org/grpc v1.68.1/go.mod h1:+q1XYFJjShcqn0QZHvCyeR4CXPA+llXIeUIfIe00waw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -744,8 +742,8 @@ k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 h1:pUdcCO1Lk/tbT5ztQWOBi5HBgbBP1 k8s.io/utils v0.0.0-20240711033017-18e509b52bc8/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= oras.land/oras-go v1.2.6 h1:z8cmxQXBU8yZ4mkytWqXfo6tZcamPwjsuxYU81xJ8Lk= oras.land/oras-go v1.2.6/go.mod h1:OVPc1PegSEe/K8YiLfosrlqlqTN9PUyFvOw5Y9gwrT8= -sigs.k8s.io/controller-runtime v0.19.1 h1:Son+Q40+Be3QWb+niBXAg2vFiYWolDjjRfO8hn/cxOk= -sigs.k8s.io/controller-runtime v0.19.1/go.mod h1:iRmWllt8IlaLjvTTDLhRBXIEtkCK6hwVBJJsYS9Ajf4= +sigs.k8s.io/controller-runtime v0.19.3 h1:XO2GvC9OPftRst6xWCpTgBZO04S2cbp0Qqkj8bX1sPw= +sigs.k8s.io/controller-runtime v0.19.3/go.mod h1:j4j87DqtsThvwTv5/Tc5NFRyyF/RF0ip4+62tbTSIUM= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= sigs.k8s.io/kustomize/api v0.18.0 h1:hTzp67k+3NEVInwz5BHyzc9rGxIauoXferXyjv5lWPo= diff --git a/internal/directives/argocd_updater.go b/internal/directives/argocd_updater.go index b93d71283..f027b4a5a 100644 --- a/internal/directives/argocd_updater.go +++ b/internal/directives/argocd_updater.go @@ -25,7 +25,7 @@ import ( const ( applicationOperationInitiator = "kargo-controller" - freightCollectionInfoKey = "kargo.akuity.io/freight-collection" + promotionInfoKey = "kargo.akuity.io/promotion" ) func init() { @@ -69,7 +69,6 @@ type argocdUpdater struct { *PromotionStepContext, *ArgoCDAppUpdate, *argocd.Application, - argocd.ApplicationSources, ) (argocd.OperationPhase, bool, error) syncApplicationFn func( @@ -207,24 +206,8 @@ func (a *argocdUpdater) runPromotionStep( DesiredRevisions: desiredRevisions, } - // Build the desired source(s) for the Argo CD Application. - desiredSources, err := a.buildDesiredSourcesFn( - ctx, - stepCtx, - &stepCfg, - update, - desiredRevisions, - app, - ) - if err != nil { - return PromotionStepResult{Status: kargoapi.PromotionPhaseErrored}, fmt.Errorf( - "error building desired sources for Argo CD Application %q in namespace %q: %w", - app.Name, app.Namespace, err, - ) - } - // Check if the update needs to be performed and retrieve its phase. - phase, mustUpdate, err := a.mustPerformUpdateFn(stepCtx, update, app, desiredSources) + phase, mustUpdate, err := a.mustPerformUpdateFn(stepCtx, update, app) // If we have a phase, append it to the results. if phase != "" { @@ -267,6 +250,22 @@ func (a *argocdUpdater) runPromotionStep( logger.Debug(err.Error()) } + // Build the desired source(s) for the Argo CD Application. + desiredSources, err := a.buildDesiredSourcesFn( + ctx, + stepCtx, + &stepCfg, + update, + desiredRevisions, + app, + ) + if err != nil { + return PromotionStepResult{Status: kargoapi.PromotionPhaseErrored}, fmt.Errorf( + "error building desired sources for Argo CD Application %q in namespace %q: %w", + app.Name, app.Namespace, err, + ) + } + // Perform the update. if err = a.syncApplicationFn( ctx, @@ -372,7 +371,6 @@ func (a *argocdUpdater) mustPerformUpdate( stepCtx *PromotionStepContext, update *ArgoCDAppUpdate, app *argocd.Application, - desiredSources argocd.ApplicationSources, ) (phase argocd.OperationPhase, mustUpdate bool, err error) { status := app.Status.OperationState if status == nil { @@ -400,23 +398,23 @@ func (a *argocdUpdater) mustPerformUpdate( // Deal with the possibility that the operation was not initiated for the // current freight collection. i.e. Not related to the current promotion. - var correctFreightColIDFound bool + var correctPromotionIDFound bool for _, info := range status.Operation.Info { - if info.Name == freightCollectionInfoKey { - correctFreightColIDFound = info.Value == stepCtx.Freight.ID + if info.Name == promotionInfoKey { + correctPromotionIDFound = info.Value == stepCtx.Promotion break } } - if !correctFreightColIDFound { - // The operation was not initiated for the current freight collection. + if !correctPromotionIDFound { + // The operation was not initiated for the current Promotion. if !status.Phase.Completed() { // We should wait for the operation to complete before attempting to // apply an update ourselves. // NB: We return the current phase here because we want the caller // to know that an operation is still running. return status.Phase, false, fmt.Errorf( - "current operation was not initiated for freight collection %q: waiting for operation to complete", - stepCtx.Freight.ID, + "current operation was not initiated for Promotion %s: waiting for operation to complete", + stepCtx.Promotion, ) } // Initiate our own operation. @@ -434,18 +432,6 @@ func (a *argocdUpdater) mustPerformUpdate( return "", true, errors.New("operation completed without a sync result") } - // Check if the desired sources were applied. - if len(update.Sources) > 0 { - if (status.SyncResult.Source.RepoURL != "" && !status.SyncResult.Source.Equals(&desiredSources[0])) || - (status.SyncResult.Source.RepoURL == "" && !status.SyncResult.Sources.Equals(desiredSources)) { - // The operation did not result in the desired sources being applied. We - // should attempt to retry the operation. - return "", true, fmt.Errorf( - "operation result source does not match desired source", - ) - } - } - // Check if the desired revisions were applied. desiredRevisions, err := a.getDesiredRevisions(stepCtx, update, app) if err != nil { @@ -514,8 +500,8 @@ func (a *argocdUpdater) syncApplication( Value: "Promotion triggered a sync of this Application resource.", }, { - Name: freightCollectionInfoKey, - Value: stepCtx.Freight.ID, + Name: promotionInfoKey, + Value: stepCtx.Promotion, }, }, Sync: &argocd.SyncOperation{ diff --git a/internal/directives/argocd_updater_test.go b/internal/directives/argocd_updater_test.go index f008ef8fe..37a5d30fb 100644 --- a/internal/directives/argocd_updater_test.go +++ b/internal/directives/argocd_updater_test.go @@ -477,7 +477,7 @@ func Test_argoCDUpdater_runPromotionStep(t *testing.T) { }, }, { - name: "error building desired sources", + name: "error determining if update is necessary", runner: &argocdUpdater{ getAuthorizedApplicationFn: func( context.Context, @@ -486,15 +486,12 @@ func Test_argoCDUpdater_runPromotionStep(t *testing.T) { ) (*v1alpha1.Application, error) { return &argocd.Application{}, nil }, - buildDesiredSourcesFn: func( - context.Context, + mustPerformUpdateFn: func( *PromotionStepContext, - *ArgoCDUpdateConfig, *ArgoCDAppUpdate, - []string, *argocd.Application, - ) (argocd.ApplicationSources, error) { - return nil, errors.New("something went wrong") + ) (argocd.OperationPhase, bool, error) { + return "", false, errors.New("something went wrong") }, }, stepCtx: &PromotionStepContext{ @@ -505,12 +502,11 @@ func Test_argoCDUpdater_runPromotionStep(t *testing.T) { }, assertions: func(t *testing.T, res PromotionStepResult, err error) { require.Equal(t, kargoapi.PromotionPhaseErrored, res.Status) - require.ErrorContains(t, err, "error building desired sources for Argo CD Application") require.ErrorContains(t, err, "something went wrong") }, }, { - name: "error determining if update is necessary", + name: "determination error can be solved by applying update", runner: &argocdUpdater{ getAuthorizedApplicationFn: func( context.Context, @@ -533,9 +529,16 @@ func Test_argoCDUpdater_runPromotionStep(t *testing.T) { *PromotionStepContext, *ArgoCDAppUpdate, *argocd.Application, - argocd.ApplicationSources, ) (argocd.OperationPhase, bool, error) { - return "", false, errors.New("something went wrong") + return "", true, errors.New("something went wrong") + }, + syncApplicationFn: func( + context.Context, + *PromotionStepContext, + *argocd.Application, + argocd.ApplicationSources, + ) error { + return nil }, }, stepCtx: &PromotionStepContext{ @@ -545,12 +548,12 @@ func Test_argoCDUpdater_runPromotionStep(t *testing.T) { Apps: []ArgoCDAppUpdate{{}}, }, assertions: func(t *testing.T, res PromotionStepResult, err error) { - require.Equal(t, kargoapi.PromotionPhaseErrored, res.Status) - require.ErrorContains(t, err, "something went wrong") + require.Equal(t, kargoapi.PromotionPhaseRunning, res.Status) + require.NoError(t, err) }, }, { - name: "determination error can be solved by applying update", + name: "must wait for update to complete", runner: &argocdUpdater{ getAuthorizedApplicationFn: func( context.Context, @@ -559,31 +562,12 @@ func Test_argoCDUpdater_runPromotionStep(t *testing.T) { ) (*v1alpha1.Application, error) { return &argocd.Application{}, nil }, - buildDesiredSourcesFn: func( - context.Context, - *PromotionStepContext, - *ArgoCDUpdateConfig, - *ArgoCDAppUpdate, - []string, - *argocd.Application, - ) (argocd.ApplicationSources, error) { - return []argocd.ApplicationSource{{}}, nil - }, mustPerformUpdateFn: func( *PromotionStepContext, *ArgoCDAppUpdate, *argocd.Application, - argocd.ApplicationSources, ) (argocd.OperationPhase, bool, error) { - return "", true, errors.New("something went wrong") - }, - syncApplicationFn: func( - context.Context, - *PromotionStepContext, - *argocd.Application, - argocd.ApplicationSources, - ) error { - return nil + return argocd.OperationRunning, false, nil }, }, stepCtx: &PromotionStepContext{ @@ -598,7 +582,7 @@ func Test_argoCDUpdater_runPromotionStep(t *testing.T) { }, }, { - name: "must wait for update to complete", + name: "must wait for operation from different user to complete", runner: &argocdUpdater{ getAuthorizedApplicationFn: func( context.Context, @@ -607,23 +591,12 @@ func Test_argoCDUpdater_runPromotionStep(t *testing.T) { ) (*v1alpha1.Application, error) { return &argocd.Application{}, nil }, - buildDesiredSourcesFn: func( - context.Context, - *PromotionStepContext, - *ArgoCDUpdateConfig, - *ArgoCDAppUpdate, - []string, - *argocd.Application, - ) (argocd.ApplicationSources, error) { - return []argocd.ApplicationSource{{}}, nil - }, mustPerformUpdateFn: func( *PromotionStepContext, *ArgoCDAppUpdate, *argocd.Application, - argocd.ApplicationSources, ) (argocd.OperationPhase, bool, error) { - return argocd.OperationRunning, false, nil + return argocd.OperationRunning, false, fmt.Errorf("waiting for operation to complete") }, }, stepCtx: &PromotionStepContext{ @@ -638,7 +611,7 @@ func Test_argoCDUpdater_runPromotionStep(t *testing.T) { }, }, { - name: "must wait for operation from different user to complete", + name: "error building desired sources", runner: &argocdUpdater{ getAuthorizedApplicationFn: func( context.Context, @@ -647,6 +620,13 @@ func Test_argoCDUpdater_runPromotionStep(t *testing.T) { ) (*v1alpha1.Application, error) { return &argocd.Application{}, nil }, + mustPerformUpdateFn: func( + *PromotionStepContext, + *ArgoCDAppUpdate, + *argocd.Application, + ) (argocd.OperationPhase, bool, error) { + return "", true, nil + }, buildDesiredSourcesFn: func( context.Context, *PromotionStepContext, @@ -655,15 +635,7 @@ func Test_argoCDUpdater_runPromotionStep(t *testing.T) { []string, *argocd.Application, ) (argocd.ApplicationSources, error) { - return []argocd.ApplicationSource{{}}, nil - }, - mustPerformUpdateFn: func( - *PromotionStepContext, - *ArgoCDAppUpdate, - *argocd.Application, - argocd.ApplicationSources, - ) (argocd.OperationPhase, bool, error) { - return argocd.OperationRunning, false, fmt.Errorf("waiting for operation to complete") + return nil, errors.New("something went wrong") }, }, stepCtx: &PromotionStepContext{ @@ -673,8 +645,9 @@ func Test_argoCDUpdater_runPromotionStep(t *testing.T) { Apps: []ArgoCDAppUpdate{{}}, }, assertions: func(t *testing.T, res PromotionStepResult, err error) { - require.Equal(t, kargoapi.PromotionPhaseRunning, res.Status) - require.NoError(t, err) + require.Equal(t, kargoapi.PromotionPhaseErrored, res.Status) + require.ErrorContains(t, err, "error building desired sources for Argo CD Application") + require.ErrorContains(t, err, "something went wrong") }, }, { @@ -687,6 +660,13 @@ func Test_argoCDUpdater_runPromotionStep(t *testing.T) { ) (*v1alpha1.Application, error) { return &argocd.Application{}, nil }, + mustPerformUpdateFn: func( + *PromotionStepContext, + *ArgoCDAppUpdate, + *argocd.Application, + ) (argocd.OperationPhase, bool, error) { + return "", true, nil + }, buildDesiredSourcesFn: func( context.Context, *PromotionStepContext, @@ -697,14 +677,6 @@ func Test_argoCDUpdater_runPromotionStep(t *testing.T) { ) (argocd.ApplicationSources, error) { return []argocd.ApplicationSource{{}}, nil }, - mustPerformUpdateFn: func( - *PromotionStepContext, - *ArgoCDAppUpdate, - *argocd.Application, - argocd.ApplicationSources, - ) (argocd.OperationPhase, bool, error) { - return "", true, nil - }, syncApplicationFn: func( context.Context, *PromotionStepContext, @@ -736,28 +708,16 @@ func Test_argoCDUpdater_runPromotionStep(t *testing.T) { ) (*v1alpha1.Application, error) { return &argocd.Application{}, nil }, - buildDesiredSourcesFn: func( - context.Context, - *PromotionStepContext, - *ArgoCDUpdateConfig, - *ArgoCDAppUpdate, - []string, - *argocd.Application, - ) (argocd.ApplicationSources, error) { - return []argocd.ApplicationSource{{}}, nil - }, mustPerformUpdateFn: func() func( *PromotionStepContext, *ArgoCDAppUpdate, *argocd.Application, - argocd.ApplicationSources, ) (argocd.OperationPhase, bool, error) { var count uint return func( *PromotionStepContext, *ArgoCDAppUpdate, *argocd.Application, - argocd.ApplicationSources, ) (argocd.OperationPhase, bool, error) { count++ if count > 1 { @@ -766,6 +726,16 @@ func Test_argoCDUpdater_runPromotionStep(t *testing.T) { return "", true, nil } }(), + buildDesiredSourcesFn: func( + context.Context, + *PromotionStepContext, + *ArgoCDUpdateConfig, + *ArgoCDAppUpdate, + []string, + *argocd.Application, + ) (argocd.ApplicationSources, error) { + return []argocd.ApplicationSource{{}}, nil + }, syncApplicationFn: func( context.Context, *PromotionStepContext, @@ -799,21 +769,10 @@ func Test_argoCDUpdater_runPromotionStep(t *testing.T) { ) (*v1alpha1.Application, error) { return &argocd.Application{}, nil }, - buildDesiredSourcesFn: func( - context.Context, - *PromotionStepContext, - *ArgoCDUpdateConfig, - *ArgoCDAppUpdate, - []string, - *argocd.Application, - ) (argocd.ApplicationSources, error) { - return []argocd.ApplicationSource{{}}, nil - }, mustPerformUpdateFn: func( *PromotionStepContext, *ArgoCDAppUpdate, *argocd.Application, - argocd.ApplicationSources, ) (argocd.OperationPhase, bool, error) { return "Unknown", false, nil }, @@ -839,21 +798,10 @@ func Test_argoCDUpdater_runPromotionStep(t *testing.T) { ) (*v1alpha1.Application, error) { return &argocd.Application{}, nil }, - buildDesiredSourcesFn: func( - context.Context, - *PromotionStepContext, - *ArgoCDUpdateConfig, - *ArgoCDAppUpdate, - []string, - *argocd.Application, - ) (argocd.ApplicationSources, error) { - return []argocd.ApplicationSource{{}}, nil - }, mustPerformUpdateFn: func( *PromotionStepContext, *ArgoCDAppUpdate, *argocd.Application, - argocd.ApplicationSources, ) (argocd.OperationPhase, bool, error) { return argocd.OperationSucceeded, false, nil }, @@ -1003,11 +951,10 @@ func Test_argoCDUpdater_buildDesiredSources(t *testing.T) { } func Test_argoCDUpdater_mustPerformUpdate(t *testing.T) { - testFreightCollectionID := "fake-freight-collection" + testPromotionID := "fake-promotion" testCases := []struct { name string modifyApplication func(*argocd.Application) - desiredSources argocd.ApplicationSources assertions func(t *testing.T, phase argocd.OperationPhase, mustUpdate bool, err error) }{ { @@ -1056,7 +1003,7 @@ func Test_argoCDUpdater_mustPerformUpdate(t *testing.T) { }, }, { - name: "running operation initiated for incorrect freight collection", + name: "running operation initiated for incorrect Promotion", modifyApplication: func(app *argocd.Application) { app.Status.OperationState = &argocd.OperationState{ Phase: argocd.OperationRunning, @@ -1065,7 +1012,7 @@ func Test_argoCDUpdater_mustPerformUpdate(t *testing.T) { Username: applicationOperationInitiator, }, Info: []*argocd.Info{{ - Name: freightCollectionInfoKey, + Name: promotionInfoKey, Value: "wrong-freight-collection", }}, }, @@ -1079,7 +1026,7 @@ func Test_argoCDUpdater_mustPerformUpdate(t *testing.T) { }, }, { - name: "completed operation initiated for incorrect freight collection", + name: "completed operation initiated for incorrect Promotion", modifyApplication: func(app *argocd.Application) { app.Status.OperationState = &argocd.OperationState{ Phase: argocd.OperationSucceeded, @@ -1088,7 +1035,7 @@ func Test_argoCDUpdater_mustPerformUpdate(t *testing.T) { Username: applicationOperationInitiator, }, Info: []*argocd.Info{{ - Name: freightCollectionInfoKey, + Name: promotionInfoKey, Value: "wrong-freight-collection", }}, }, @@ -1110,8 +1057,8 @@ func Test_argoCDUpdater_mustPerformUpdate(t *testing.T) { Username: applicationOperationInitiator, }, Info: []*argocd.Info{{ - Name: freightCollectionInfoKey, - Value: testFreightCollectionID, + Name: promotionInfoKey, + Value: testPromotionID, }}, }, } @@ -1132,8 +1079,8 @@ func Test_argoCDUpdater_mustPerformUpdate(t *testing.T) { Username: applicationOperationInitiator, }, Info: []*argocd.Info{{ - Name: freightCollectionInfoKey, - Value: testFreightCollectionID, + Name: promotionInfoKey, + Value: testPromotionID, }}, }, SyncResult: &argocd.SyncOperationResult{}, @@ -1158,8 +1105,8 @@ func Test_argoCDUpdater_mustPerformUpdate(t *testing.T) { Username: applicationOperationInitiator, }, Info: []*argocd.Info{{ - Name: freightCollectionInfoKey, - Value: testFreightCollectionID, + Name: promotionInfoKey, + Value: testPromotionID, }}, }, } @@ -1183,8 +1130,8 @@ func Test_argoCDUpdater_mustPerformUpdate(t *testing.T) { Username: applicationOperationInitiator, }, Info: []*argocd.Info{{ - Name: freightCollectionInfoKey, - Value: testFreightCollectionID, + Name: promotionInfoKey, + Value: testPromotionID, }}, }, SyncResult: &argocd.SyncOperationResult{ @@ -1199,46 +1146,6 @@ func Test_argoCDUpdater_mustPerformUpdate(t *testing.T) { require.True(t, mustUpdate) }, }, - { - name: "desired sources do not match operation state", - modifyApplication: func(app *argocd.Application) { - app.Spec.Sources = argocd.ApplicationSources{ - { - RepoURL: "https://github.com/universe/42", - }, - } - app.Status.OperationState = &argocd.OperationState{ - Phase: argocd.OperationSucceeded, - Operation: argocd.Operation{ - InitiatedBy: argocd.OperationInitiator{ - Username: applicationOperationInitiator, - }, - Info: []*argocd.Info{{ - Name: freightCollectionInfoKey, - Value: testFreightCollectionID, - }}, - }, - SyncResult: &argocd.SyncOperationResult{ - Revision: "fake-revision", - Sources: argocd.ApplicationSources{ - { - RepoURL: "https://github.com/different/universe", - }, - }, - }, - } - }, - desiredSources: argocd.ApplicationSources{ - { - RepoURL: "https://github.com/universe/42", - }, - }, - assertions: func(t *testing.T, phase argocd.OperationPhase, mustUpdate bool, err error) { - require.ErrorContains(t, err, "does not match desired source") - require.Empty(t, phase) - require.True(t, mustUpdate) - }, - }, { name: "operation completed", modifyApplication: func(app *argocd.Application) { @@ -1252,8 +1159,8 @@ func Test_argoCDUpdater_mustPerformUpdate(t *testing.T) { Username: applicationOperationInitiator, }, Info: []*argocd.Info{{ - Name: freightCollectionInfoKey, - Value: testFreightCollectionID, + Name: promotionInfoKey, + Value: testPromotionID, }}, }, SyncResult: &argocd.SyncOperationResult{ @@ -1293,15 +1200,9 @@ func Test_argoCDUpdater_mustPerformUpdate(t *testing.T) { } phase, mustUpdate, err := runner.mustPerformUpdate( - &PromotionStepContext{ - Freight: kargoapi.FreightCollection{ - // Hard-coded for testing purposes - ID: testFreightCollectionID, - }, - }, + &PromotionStepContext{Promotion: testPromotionID}, &stepCfg.Apps[0], app, - testCase.desiredSources, ) testCase.assertions(t, phase, mustUpdate, err) })