From 7f01079eaa2f8cf46ef4dca2541e3cec30e7b598 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Jan 2024 01:37:35 +0000 Subject: [PATCH 01/33] :seedling: Bump golang.org/x/tools from 0.16.1 to 0.17.0 Bumps [golang.org/x/tools](https://github.com/golang/tools) from 0.16.1 to 0.17.0. - [Release notes](https://github.com/golang/tools/releases) - [Commits](https://github.com/golang/tools/compare/v0.16.1...v0.17.0) --- updated-dependencies: - dependency-name: golang.org/x/tools dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 6 +++--- go.sum | 25 +++++++------------------ 2 files changed, 10 insertions(+), 21 deletions(-) diff --git a/go.mod b/go.mod index 0a9d684b6..de2139db2 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/onsi/gomega v1.30.0 github.com/spf13/cobra v1.8.0 github.com/spf13/pflag v1.0.5 - golang.org/x/tools v0.16.1 + golang.org/x/tools v0.17.0 gopkg.in/yaml.v2 v2.4.0 gopkg.in/yaml.v3 v3.0.1 k8s.io/api v0.29.0 @@ -32,8 +32,8 @@ require ( github.com/modern-go/reflect2 v1.0.2 // indirect github.com/nxadm/tail v1.4.8 // indirect golang.org/x/mod v0.14.0 // indirect - golang.org/x/net v0.19.0 // indirect - golang.org/x/sys v0.15.0 // indirect + golang.org/x/net v0.20.0 // indirect + golang.org/x/sys v0.16.0 // indirect golang.org/x/text v0.14.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect diff --git a/go.sum b/go.sum index fb81a92df..f78afce02 100644 --- a/go.sum +++ b/go.sum @@ -12,7 +12,6 @@ github.com/go-logr/logr v1.3.0 h1:2y3SDp0ZXuc6/cjLSZ+Q3ir+QB9T/iG5yYRXqsagWSY= github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= -github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls= github.com/gobuffalo/flect v1.0.2 h1:eqjPGSo2WmjgY2XlpGwo2NXgL3RucAKo4k4qQMNA5sA= github.com/gobuffalo/flect v1.0.2/go.mod h1:A5msMlrHtLqh9umBSnvabjsMrCcCpAyzglnDvkbYKHs= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= @@ -25,7 +24,6 @@ github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:W github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= -github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= @@ -36,7 +34,6 @@ github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/ github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 h1:K6RDEckDVWvDI9JAJYCmNdQXq6neHJOYx3V6jnqNEec= -github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= @@ -45,9 +42,7 @@ github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHm github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= -github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= -github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= @@ -66,7 +61,6 @@ github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108 github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= github.com/onsi/ginkgo/v2 v2.13.0 h1:0jY9lJquiL8fcf3M4LAXN5aMlS/b2BV86HFFPCPMgE4= -github.com/onsi/ginkgo/v2 v2.13.0/go.mod h1:TE309ZR8s5FsKKpuB1YAQYBzCaAfUgatB/xlT/ETL/o= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.30.0 h1:hvMK7xYz4D3HapigLTeGdId/NcfQx1VHMJc60ew99+8= @@ -74,7 +68,6 @@ github.com/onsi/gomega v1.30.0/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8P github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= -github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0= github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho= @@ -89,7 +82,6 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= -github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= @@ -105,14 +97,13 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.19.0 h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c= -golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U= +golang.org/x/net v0.20.0 h1:aCL9BSgETF1k+blQaYUBx9hJ9LOGP3gAVemcZlf1Kpo= +golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE= -golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -124,8 +115,8 @@ golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= -golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU= +golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= @@ -135,8 +126,8 @@ golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.16.1 h1:TLyB3WofjdOEepBHAU20JdNC1Zbg87elYofWYAY5oZA= -golang.org/x/tools v0.16.1/go.mod h1:kYVVN6I1mBNoB1OX+noeBjbRk4IUEPa7JJ+TJMEooJ0= +golang.org/x/tools v0.17.0 h1:FvmRgNOcs3kOa+T20R1uhfP9F6HgG2mfxDv1vrx1Htc= +golang.org/x/tools v0.17.0/go.mod h1:xsh6VxdV005rRVaS6SSAf9oiAqljS7UZUacMZ8Bnsps= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -148,10 +139,8 @@ google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miE google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= -google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= From 16922296756d713e186d73ed761e2be15324d957 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Jan 2024 01:54:13 +0000 Subject: [PATCH 02/33] :seedling: Bump github.com/onsi/gomega from 1.30.0 to 1.31.1 Bumps [github.com/onsi/gomega](https://github.com/onsi/gomega) from 1.30.0 to 1.31.1. - [Release notes](https://github.com/onsi/gomega/releases) - [Changelog](https://github.com/onsi/gomega/blob/master/CHANGELOG.md) - [Commits](https://github.com/onsi/gomega/compare/v1.30.0...v1.31.1) --- updated-dependencies: - dependency-name: github.com/onsi/gomega dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index de2139db2..ddabf717f 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ require ( github.com/gobuffalo/flect v1.0.2 github.com/google/go-cmp v0.6.0 github.com/onsi/ginkgo v1.16.5 - github.com/onsi/gomega v1.30.0 + github.com/onsi/gomega v1.31.1 github.com/spf13/cobra v1.8.0 github.com/spf13/pflag v1.0.5 golang.org/x/tools v0.17.0 diff --git a/go.sum b/go.sum index f78afce02..c4bd9babb 100644 --- a/go.sum +++ b/go.sum @@ -60,11 +60,11 @@ github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+W github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= -github.com/onsi/ginkgo/v2 v2.13.0 h1:0jY9lJquiL8fcf3M4LAXN5aMlS/b2BV86HFFPCPMgE4= +github.com/onsi/ginkgo/v2 v2.15.0 h1:79HwNRBAZHOEwrczrgSOPy+eFTTlIGELKy5as+ClttY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= -github.com/onsi/gomega v1.30.0 h1:hvMK7xYz4D3HapigLTeGdId/NcfQx1VHMJc60ew99+8= -github.com/onsi/gomega v1.30.0/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ= +github.com/onsi/gomega v1.31.1 h1:KYppCUK+bUgAZwHOu7EXVBKyQA6ILvOESHkn/tgoqvo= +github.com/onsi/gomega v1.31.1/go.mod h1:y40C95dwAD1Nz36SsEnxvfFe8FFfNxzI5eJ0EYGyAy0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= From b67d9438233b0666bc09de32e4ca5a580ed28d26 Mon Sep 17 00:00:00 2001 From: Dave Protasowski Date: Mon, 5 Feb 2024 05:35:45 -0500 Subject: [PATCH 03/33] :sparkles: Markers can now indicate their priority when applying (#706) * Markers can now indicate their priority when applying * add unit test to ensure marker invocation * add example in godoc * drop unused struct param * update godoc * run goimports * change marker constants * add godoc comment * address feedback * add comment that ordering is for validation markers for now * fix godoc comment --- pkg/crd/markers/doc.go | 17 +++++++-- pkg/crd/markers/priority.go | 37 ++++++++++++++++++++ pkg/crd/markers/topology.go | 4 ++- pkg/crd/markers/validation.go | 8 +++-- pkg/crd/schema.go | 57 ++++++++++++++++-------------- pkg/crd/schema_test.go | 66 +++++++++++++++++++++++++++++++++++ 6 files changed, 158 insertions(+), 31 deletions(-) create mode 100644 pkg/crd/markers/priority.go diff --git a/pkg/crd/markers/doc.go b/pkg/crd/markers/doc.go index 995af44b3..f01e9f1b3 100644 --- a/pkg/crd/markers/doc.go +++ b/pkg/crd/markers/doc.go @@ -26,7 +26,20 @@ limitations under the License. // be run after the rest of a given schema node has been generated. // Markers that need to be run before any other markers can also // implement ApplyFirst, but this is discouraged and may change -// in the future. +// in the future. It is recommended to implement the ApplyPriority +// interface in combination with ApplyPriorityDefault and +// ApplyPriorityFirst constants. Following is an example of how to +// implement such a marker: +// +// type MyCustomMarker string +// +// func (m MyCustomMarker) ApplyPriority() ApplyPriority { +// return ApplyPriorityFirst +// } +// +// func (m MyCustomMarker) ApplyToSchema(schema *apiext.JSONSchemaProps) error { +// ... +// } // // All validation markers start with "+kubebuilder:validation", and // have the same name as their type name. @@ -34,7 +47,7 @@ limitations under the License. // # CRD Markers // // Markers that modify anything in the CRD itself *except* for the schema -// implement ApplyToCRD (crd.CRDMarker). They are expected to detect whether +// implement ApplyToCRD (crd.SpecMarker). They are expected to detect whether // they should apply themselves to a specific version in the CRD (as passed to // them), or to the root-level CRD for legacy cases. They are applied *after* // the rest of the CRD is computed. diff --git a/pkg/crd/markers/priority.go b/pkg/crd/markers/priority.go new file mode 100644 index 000000000..1b4482521 --- /dev/null +++ b/pkg/crd/markers/priority.go @@ -0,0 +1,37 @@ +/* +Copyright 2022 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package markers + +// ApplyPriority designates the order markers should be applied. +// Lower priority indicates it should be applied first +type ApplyPriority int64 + +const ( + // ApplyPriorityDefault is the default priority for markers + // that don't implement ApplyPriorityMarker + ApplyPriorityDefault ApplyPriority = 10 + + // ApplyPriorityFirst is the priority value assigned to markers + // that implement the ApplyFirst() method + ApplyPriorityFirst ApplyPriority = 1 +) + +// ApplyPriorityMarker designates the order validation markers should be applied. +// Lower priority indicates it should be applied first +type ApplyPriorityMarker interface { + ApplyPriority() ApplyPriority +} diff --git a/pkg/crd/markers/topology.go b/pkg/crd/markers/topology.go index a92995c80..97dbc47c5 100644 --- a/pkg/crd/markers/topology.go +++ b/pkg/crd/markers/topology.go @@ -119,7 +119,9 @@ func (l ListType) ApplyToSchema(schema *apiext.JSONSchemaProps) error { return nil } -func (l ListType) ApplyFirst() {} +func (l ListType) ApplyPriority() ApplyPriority { + return ApplyPriorityDefault - 1 +} func (l ListMapKey) ApplyToSchema(schema *apiext.JSONSchemaProps) error { if schema.Type != "array" { diff --git a/pkg/crd/markers/validation.go b/pkg/crd/markers/validation.go index 40aec5f94..48c89e6d0 100644 --- a/pkg/crd/markers/validation.go +++ b/pkg/crd/markers/validation.go @@ -464,7 +464,9 @@ func (m Type) ApplyToSchema(schema *apiext.JSONSchemaProps) error { return nil } -func (m Type) ApplyFirst() {} +func (m Type) ApplyPriority() ApplyPriority { + return ApplyPriorityDefault - 1 +} func (m Nullable) ApplyToSchema(schema *apiext.JSONSchemaProps) error { schema.Nullable = true @@ -512,7 +514,9 @@ func (m XIntOrString) ApplyToSchema(schema *apiext.JSONSchemaProps) error { return nil } -func (m XIntOrString) ApplyFirst() {} +func (m XIntOrString) ApplyPriority() ApplyPriority { + return ApplyPriorityDefault - 1 +} func (m XValidation) ApplyToSchema(schema *apiext.JSONSchemaProps) error { schema.XValidations = append(schema.XValidations, apiext.ValidationRule{ diff --git a/pkg/crd/schema.go b/pkg/crd/schema.go index e76d3ea88..a5c2f28c9 100644 --- a/pkg/crd/schema.go +++ b/pkg/crd/schema.go @@ -22,6 +22,7 @@ import ( "go/ast" "go/token" "go/types" + "sort" "strings" apiext "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" @@ -124,41 +125,45 @@ func infoToSchema(ctx *schemaContext) *apiext.JSONSchemaProps { return typeToSchema(ctx, ctx.info.RawSpec.Type) } -// applyMarkers applies schema markers to the given schema, respecting "apply first" markers. +// applyMarkers applies schema markers given their priority to the given schema func applyMarkers(ctx *schemaContext, markerSet markers.MarkerValues, props *apiext.JSONSchemaProps, node ast.Node) { - // apply "apply first" markers first... + markers := make([]SchemaMarker, 0, len(markerSet)) + for _, markerValues := range markerSet { for _, markerValue := range markerValues { - if _, isApplyFirst := markerValue.(applyFirstMarker); !isApplyFirst { - continue + if schemaMarker, isSchemaMarker := markerValue.(SchemaMarker); isSchemaMarker { + markers = append(markers, schemaMarker) } + } + } - schemaMarker, isSchemaMarker := markerValue.(SchemaMarker) - if !isSchemaMarker { - continue - } + sort.Slice(markers, func(i, j int) bool { + var iPriority, jPriority crdmarkers.ApplyPriority - if err := schemaMarker.ApplyToSchema(props); err != nil { - ctx.pkg.AddError(loader.ErrFromNode(err /* an okay guess */, node)) - } + switch m := markers[i].(type) { + case crdmarkers.ApplyPriorityMarker: + iPriority = m.ApplyPriority() + case applyFirstMarker: + iPriority = crdmarkers.ApplyPriorityFirst + default: + iPriority = crdmarkers.ApplyPriorityDefault } - } - // ...then the rest of the markers - for _, markerValues := range markerSet { - for _, markerValue := range markerValues { - if _, isApplyFirst := markerValue.(applyFirstMarker); isApplyFirst { - // skip apply-first markers, which were already applied - continue - } + switch m := markers[j].(type) { + case crdmarkers.ApplyPriorityMarker: + jPriority = m.ApplyPriority() + case applyFirstMarker: + jPriority = crdmarkers.ApplyPriorityFirst + default: + jPriority = crdmarkers.ApplyPriorityDefault + } - schemaMarker, isSchemaMarker := markerValue.(SchemaMarker) - if !isSchemaMarker { - continue - } - if err := schemaMarker.ApplyToSchema(props); err != nil { - ctx.pkg.AddError(loader.ErrFromNode(err /* an okay guess */, node)) - } + return iPriority < jPriority + }) + + for _, schemaMarker := range markers { + if err := schemaMarker.ApplyToSchema(props); err != nil { + ctx.pkg.AddError(loader.ErrFromNode(err /* an okay guess */, node)) } } } diff --git a/pkg/crd/schema_test.go b/pkg/crd/schema_test.go index 5b8fa03fc..9c0581d6f 100644 --- a/pkg/crd/schema_test.go +++ b/pkg/crd/schema_test.go @@ -25,6 +25,7 @@ import ( "golang.org/x/tools/go/packages" pkgstest "golang.org/x/tools/go/packages/packagestest" apiext "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" + crdmarkers "sigs.k8s.io/controller-tools/pkg/crd/markers" testloader "sigs.k8s.io/controller-tools/pkg/loader/testutils" "sigs.k8s.io/controller-tools/pkg/markers" ) @@ -110,3 +111,68 @@ func Test_Schema_MapOfStringToArrayOfFloat32(t *testing.T) { }, })) } + +func Test_Schema_ApplyMarkers(t *testing.T) { + g := gomega.NewWithT(t) + + props := &apiext.JSONSchemaProps{} + ctx := &schemaContext{} + + var invocations []string + + applyMarkers(ctx, markers.MarkerValues{ + "blah": []interface{}{ + &testPriorityMarker{ + priority: 0, callback: func() { + invocations = append(invocations, "0") + }, + }, + &testPriorityMarker{priority: 2, callback: func() { + invocations = append(invocations, "2") + }}, + &testPriorityMarker{priority: 11, callback: func() { + invocations = append(invocations, "11") + }}, + &defaultPriorityMarker{callback: func() { + invocations = append(invocations, "default") + }}, + &testapplyFirstMarker{callback: func() { + invocations = append(invocations, "applyFirst") + }}, + }}, props, nil) + + g.Expect(invocations).To(gomega.Equal([]string{"0", "applyFirst", "2", "default", "11"})) +} + +type defaultPriorityMarker struct { + callback func() +} + +func (m *defaultPriorityMarker) ApplyToSchema(*apiext.JSONSchemaProps) error { + m.callback() + return nil +} + +type testPriorityMarker struct { + priority crdmarkers.ApplyPriority + callback func() +} + +func (m *testPriorityMarker) ApplyPriority() crdmarkers.ApplyPriority { + return m.priority +} + +func (m *testPriorityMarker) ApplyToSchema(*apiext.JSONSchemaProps) error { + m.callback() + return nil +} + +type testapplyFirstMarker struct { + callback func() +} + +func (m *testapplyFirstMarker) ApplyFirst() {} +func (m *testapplyFirstMarker) ApplyToSchema(*apiext.JSONSchemaProps) error { + m.callback() + return nil +} From eee017df14f70797c5719001e0e6bc7ca59fb212 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Mon, 12 Feb 2024 13:57:36 +0100 Subject: [PATCH 04/33] Upgrade go version from 1.20 to 1.21 --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index ddabf717f..80dca0c6a 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module sigs.k8s.io/controller-tools -go 1.20 +go 1.21 require ( github.com/fatih/color v1.16.0 From 8b39e8038ffc4c2a292d9488a85d382056a0e5f7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 Feb 2024 01:59:23 +0000 Subject: [PATCH 05/33] :seedling: Bump golang.org/x/tools from 0.17.0 to 0.18.0 Bumps [golang.org/x/tools](https://github.com/golang/tools) from 0.17.0 to 0.18.0. - [Release notes](https://github.com/golang/tools/releases) - [Commits](https://github.com/golang/tools/compare/v0.17.0...v0.18.0) --- updated-dependencies: - dependency-name: golang.org/x/tools dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 8 ++++---- go.sum | 16 ++++++++-------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/go.mod b/go.mod index ddabf717f..343ec5cb6 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/onsi/gomega v1.31.1 github.com/spf13/cobra v1.8.0 github.com/spf13/pflag v1.0.5 - golang.org/x/tools v0.17.0 + golang.org/x/tools v0.18.0 gopkg.in/yaml.v2 v2.4.0 gopkg.in/yaml.v3 v3.0.1 k8s.io/api v0.29.0 @@ -31,9 +31,9 @@ require ( github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/nxadm/tail v1.4.8 // indirect - golang.org/x/mod v0.14.0 // indirect - golang.org/x/net v0.20.0 // indirect - golang.org/x/sys v0.16.0 // indirect + golang.org/x/mod v0.15.0 // indirect + golang.org/x/net v0.21.0 // indirect + golang.org/x/sys v0.17.0 // indirect golang.org/x/text v0.14.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect diff --git a/go.sum b/go.sum index c4bd9babb..a661a8a11 100644 --- a/go.sum +++ b/go.sum @@ -89,16 +89,16 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0= -golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.15.0 h1:SernR4v+D55NyBH2QiEQrlBAnj1ECL6AGrA5+dPaMY8= +golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.20.0 h1:aCL9BSgETF1k+blQaYUBx9hJ9LOGP3gAVemcZlf1Kpo= -golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= +golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4= +golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -115,8 +115,8 @@ golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU= -golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y= +golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= @@ -126,8 +126,8 @@ golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.17.0 h1:FvmRgNOcs3kOa+T20R1uhfP9F6HgG2mfxDv1vrx1Htc= -golang.org/x/tools v0.17.0/go.mod h1:xsh6VxdV005rRVaS6SSAf9oiAqljS7UZUacMZ8Bnsps= +golang.org/x/tools v0.18.0 h1:k8NLag8AGHnn+PHbl7g43CtqZAwG60vZkLqgyZgIHgQ= +golang.org/x/tools v0.18.0/go.mod h1:GL7B4CwcLLeo59yx/9UWWuNOW1n3VZ4f5axWfML7Lcg= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= From f8dc1bd3ea88a654601959b3be447cdb387463d2 Mon Sep 17 00:00:00 2001 From: Koichi Shiraishi Date: Wed, 14 Feb 2024 13:17:02 +0900 Subject: [PATCH 06/33] pkg: fix deprecated things Signed-off-by: Koichi Shiraishi --- pkg/crd/schema.go | 2 +- pkg/loader/loader.go | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pkg/crd/schema.go b/pkg/crd/schema.go index a5c2f28c9..cc2adc758 100644 --- a/pkg/crd/schema.go +++ b/pkg/crd/schema.go @@ -458,7 +458,7 @@ func builtinToType(basic *types.Basic, allowDangerousTypes bool) (typ string, fo // Open coded go/types representation of encoding/json.Marshaller var jsonMarshaler = types.NewInterfaceType([]*types.Func{ types.NewFunc(token.NoPos, nil, "MarshalJSON", - types.NewSignature(nil, nil, + types.NewSignatureType(nil, nil, nil, nil, types.NewTuple( types.NewVar(token.NoPos, nil, "", types.NewSlice(types.Universe.Lookup("byte").Type())), types.NewVar(token.NoPos, nil, "", types.Universe.Lookup("error").Type())), false)), diff --git a/pkg/loader/loader.go b/pkg/loader/loader.go index 7762e53e7..f272aaae2 100644 --- a/pkg/loader/loader.go +++ b/pkg/loader/loader.go @@ -370,7 +370,7 @@ func LoadRootsWithConfig(cfg *packages.Config, roots ...string) ([]*Package, err cfg: cfg, packages: make(map[*packages.Package]*Package), } - l.cfg.Mode |= packages.LoadImports | packages.NeedTypesSizes + l.cfg.Mode |= packages.NeedName | packages.NeedFiles | packages.NeedCompiledGoFiles | packages.NeedImports | packages.NeedTypesSizes if l.cfg.Fset == nil { l.cfg.Fset = token.NewFileSet() } @@ -393,7 +393,7 @@ func LoadRootsWithConfig(cfg *packages.Config, roots ...string) ([]*Package, err // and try and prevent packages from showing up twice when nested module // support is enabled. there is not harm that comes from this per se, but // it makes testing easier when a known number of modules can be asserted - uniquePkgIDs := sets.String{} + uniquePkgIDs := sets.Set[string]{} // loadPackages returns the Go packages for the provided roots // @@ -604,9 +604,9 @@ func LoadRootsWithConfig(cfg *packages.Config, roots ...string) ([]*Package, err // references with those from the rootPkgs list. This ensures the // kubebuilder marker generation is handled correctly. For more info, // please see issue 680. -func visitImports(rootPkgs []*Package, pkg *Package, seen sets.String) { +func visitImports(rootPkgs []*Package, pkg *Package, seen sets.Set[string]) { if seen == nil { - seen = sets.String{} + seen = sets.Set[string]{} } for importedPkgID, importedPkg := range pkg.Imports() { for i := range rootPkgs { From a090aa887848a137119ef6fbfbba9b49e18d0f5b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Mar 2024 01:34:26 +0000 Subject: [PATCH 07/33] :seedling: Bump golang.org/x/tools from 0.18.0 to 0.19.0 Bumps [golang.org/x/tools](https://github.com/golang/tools) from 0.18.0 to 0.19.0. - [Release notes](https://github.com/golang/tools/releases) - [Commits](https://github.com/golang/tools/compare/v0.18.0...v0.19.0) --- updated-dependencies: - dependency-name: golang.org/x/tools dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 8 ++++---- go.sum | 27 +++++++++++++++++++-------- 2 files changed, 23 insertions(+), 12 deletions(-) diff --git a/go.mod b/go.mod index 5db23badf..2ed7f2a0c 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/onsi/gomega v1.31.1 github.com/spf13/cobra v1.8.0 github.com/spf13/pflag v1.0.5 - golang.org/x/tools v0.18.0 + golang.org/x/tools v0.19.0 gopkg.in/yaml.v2 v2.4.0 gopkg.in/yaml.v3 v3.0.1 k8s.io/api v0.29.0 @@ -31,9 +31,9 @@ require ( github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/nxadm/tail v1.4.8 // indirect - golang.org/x/mod v0.15.0 // indirect - golang.org/x/net v0.21.0 // indirect - golang.org/x/sys v0.17.0 // indirect + golang.org/x/mod v0.16.0 // indirect + golang.org/x/net v0.22.0 // indirect + golang.org/x/sys v0.18.0 // indirect golang.org/x/text v0.14.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect diff --git a/go.sum b/go.sum index a661a8a11..44c6e7708 100644 --- a/go.sum +++ b/go.sum @@ -12,6 +12,7 @@ github.com/go-logr/logr v1.3.0 h1:2y3SDp0ZXuc6/cjLSZ+Q3ir+QB9T/iG5yYRXqsagWSY= github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= +github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls= github.com/gobuffalo/flect v1.0.2 h1:eqjPGSo2WmjgY2XlpGwo2NXgL3RucAKo4k4qQMNA5sA= github.com/gobuffalo/flect v1.0.2/go.mod h1:A5msMlrHtLqh9umBSnvabjsMrCcCpAyzglnDvkbYKHs= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= @@ -24,6 +25,7 @@ github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:W github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= +github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= @@ -34,6 +36,7 @@ github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/ github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 h1:K6RDEckDVWvDI9JAJYCmNdQXq6neHJOYx3V6jnqNEec= +github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= @@ -42,7 +45,9 @@ github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHm github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= @@ -61,6 +66,7 @@ github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108 github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= github.com/onsi/ginkgo/v2 v2.15.0 h1:79HwNRBAZHOEwrczrgSOPy+eFTTlIGELKy5as+ClttY= +github.com/onsi/ginkgo/v2 v2.15.0/go.mod h1:HlxMHtYF57y6Dpf+mc5529KKmSq9h2FpCF+/ZkwUxKM= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.31.1 h1:KYppCUK+bUgAZwHOu7EXVBKyQA6ILvOESHkn/tgoqvo= @@ -68,6 +74,7 @@ github.com/onsi/gomega v1.31.1/go.mod h1:y40C95dwAD1Nz36SsEnxvfFe8FFfNxzI5eJ0EYG github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= +github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0= github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho= @@ -82,6 +89,7 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= @@ -89,21 +97,22 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.15.0 h1:SernR4v+D55NyBH2QiEQrlBAnj1ECL6AGrA5+dPaMY8= -golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.16.0 h1:QX4fJ0Rr5cPQCF7O9lh9Se4pmwfwskqZfq5moyldzic= +golang.org/x/mod v0.16.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4= -golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= +golang.org/x/net v0.22.0 h1:9sGLhx7iRIHEiX0oAJ3MRZMUCElJgy7Br1nO+AMN3Tc= +golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= +golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -115,8 +124,8 @@ golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y= -golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= +golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= @@ -126,8 +135,8 @@ golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.18.0 h1:k8NLag8AGHnn+PHbl7g43CtqZAwG60vZkLqgyZgIHgQ= -golang.org/x/tools v0.18.0/go.mod h1:GL7B4CwcLLeo59yx/9UWWuNOW1n3VZ4f5axWfML7Lcg= +golang.org/x/tools v0.19.0 h1:tfGCXNR1OsFG+sVdLAitlpjAvD/I6dHDKnYrpEZUHkw= +golang.org/x/tools v0.19.0/go.mod h1:qoJWxmGSIBmAeriMx19ogtrEPrGtDbPK634QFIcLAhc= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -139,8 +148,10 @@ google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miE google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= +google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= From e9698cc4046249c7daf5dd7f1165ed69b2769d84 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Mar 2024 02:14:03 +0000 Subject: [PATCH 08/33] :seedling: Bump github.com/onsi/gomega from 1.31.1 to 1.32.0 Bumps [github.com/onsi/gomega](https://github.com/onsi/gomega) from 1.31.1 to 1.32.0. - [Release notes](https://github.com/onsi/gomega/releases) - [Changelog](https://github.com/onsi/gomega/blob/master/CHANGELOG.md) - [Commits](https://github.com/onsi/gomega/compare/v1.31.1...v1.32.0) --- updated-dependencies: - dependency-name: github.com/onsi/gomega dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 10 ++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/go.mod b/go.mod index 2ed7f2a0c..c5cb6aeb7 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ require ( github.com/gobuffalo/flect v1.0.2 github.com/google/go-cmp v0.6.0 github.com/onsi/ginkgo v1.16.5 - github.com/onsi/gomega v1.31.1 + github.com/onsi/gomega v1.32.0 github.com/spf13/cobra v1.8.0 github.com/spf13/pflag v1.0.5 golang.org/x/tools v0.19.0 diff --git a/go.sum b/go.sum index 44c6e7708..01e69fef1 100644 --- a/go.sum +++ b/go.sum @@ -24,8 +24,6 @@ github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrU github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= -github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= @@ -69,8 +67,8 @@ github.com/onsi/ginkgo/v2 v2.15.0 h1:79HwNRBAZHOEwrczrgSOPy+eFTTlIGELKy5as+ClttY github.com/onsi/ginkgo/v2 v2.15.0/go.mod h1:HlxMHtYF57y6Dpf+mc5529KKmSq9h2FpCF+/ZkwUxKM= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= -github.com/onsi/gomega v1.31.1 h1:KYppCUK+bUgAZwHOu7EXVBKyQA6ILvOESHkn/tgoqvo= -github.com/onsi/gomega v1.31.1/go.mod h1:y40C95dwAD1Nz36SsEnxvfFe8FFfNxzI5eJ0EYGyAy0= +github.com/onsi/gomega v1.32.0 h1:JRYU78fJ1LPxlckP6Txi/EYqJvjtMrDC04/MM5XRHPk= +github.com/onsi/gomega v1.32.0/go.mod h1:a4x4gW6Pz2yK1MAmvluYme5lvYTn61afQ2ETw/8n4Lg= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= @@ -147,8 +145,8 @@ google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQ google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= -google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= +google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= From 5c4990cbe70b2389180e5d5c5a3730dac4e96ebf Mon Sep 17 00:00:00 2001 From: Alexander Yastrebov Date: Tue, 26 Mar 2024 19:08:59 +0100 Subject: [PATCH 09/33] pkg/crd: support validating internal list items on list types For #342 Signed-off-by: Alexander Yastrebov --- pkg/crd/markers/register.go | 10 +++- pkg/crd/markers/validation.go | 32 ++++++++---- pkg/crd/schema.go | 29 +++++++++-- pkg/crd/testdata/cronjob_types.go | 36 ++++++++++++- .../testdata.kubebuilder.io_cronjobs.yaml | 51 ++++++++++++++++++- 5 files changed, 142 insertions(+), 16 deletions(-) diff --git a/pkg/crd/markers/register.go b/pkg/crd/markers/register.go index 0e7c42694..5988a1b5b 100644 --- a/pkg/crd/markers/register.go +++ b/pkg/crd/markers/register.go @@ -42,6 +42,14 @@ func (d *definitionWithHelp) Register(reg *markers.Registry) error { return nil } +func (d *definitionWithHelp) clone() *definitionWithHelp { + newDef, newHelp := *d.Definition, *d.Help + return &definitionWithHelp{ + Definition: &newDef, + Help: &newHelp, + } +} + func must(def *markers.Definition, err error) *definitionWithHelp { return &definitionWithHelp{ Definition: markers.Must(def, err), @@ -60,7 +68,7 @@ type hasHelp interface { func mustMakeAllWithPrefix(prefix string, target markers.TargetType, objs ...interface{}) []*definitionWithHelp { defs := make([]*definitionWithHelp, len(objs)) for i, obj := range objs { - name := prefix + ":" + reflect.TypeOf(obj).Name() + name := prefix + reflect.TypeOf(obj).Name() def, err := markers.MakeDefinition(name, target, obj) if err != nil { panic(err) diff --git a/pkg/crd/markers/validation.go b/pkg/crd/markers/validation.go index 48c89e6d0..e8e67f74e 100644 --- a/pkg/crd/markers/validation.go +++ b/pkg/crd/markers/validation.go @@ -20,6 +20,7 @@ import ( "encoding/json" "fmt" "math" + "strings" apiext "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" @@ -27,7 +28,10 @@ import ( ) const ( - SchemalessName = "kubebuilder:validation:Schemaless" + validationPrefix = "kubebuilder:validation:" + + SchemalessName = "kubebuilder:validation:Schemaless" + ValidationItemsPrefix = validationPrefix + "items:" ) // ValidationMarkers lists all available markers that affect CRD schema generation, @@ -35,7 +39,9 @@ const ( // All markers start with `+kubebuilder:validation:`, and continue with their type name. // A copy is produced of all markers that describes types as well, for making types // reusable and writing complex validations on slice items. -var ValidationMarkers = mustMakeAllWithPrefix("kubebuilder:validation", markers.DescribesField, +// At last a copy of all markers with the prefix `+kubebuilder:validation:items:` is +// produced for marking slice fields and types. +var ValidationMarkers = mustMakeAllWithPrefix(validationPrefix, markers.DescribesField, // numeric markers @@ -110,14 +116,22 @@ func init() { AllDefinitions = append(AllDefinitions, ValidationMarkers...) for _, def := range ValidationMarkers { - newDef := *def.Definition - // copy both parts so we don't change the definition - typDef := definitionWithHelp{ - Definition: &newDef, - Help: def.Help, - } + typDef := def.clone() typDef.Target = markers.DescribesType - AllDefinitions = append(AllDefinitions, &typDef) + AllDefinitions = append(AllDefinitions, typDef) + + itemsName := ValidationItemsPrefix + strings.TrimPrefix(def.Name, validationPrefix) + + itemsFieldDef := def.clone() + itemsFieldDef.Name = itemsName + itemsFieldDef.Help.Summary = "for array items " + itemsFieldDef.Help.Summary + AllDefinitions = append(AllDefinitions, itemsFieldDef) + + itemsTypDef := def.clone() + itemsTypDef.Name = itemsName + itemsTypDef.Help.Summary = "for array items " + itemsTypDef.Help.Summary + itemsTypDef.Target = markers.DescribesType + AllDefinitions = append(AllDefinitions, itemsTypDef) } AllDefinitions = append(AllDefinitions, FieldOnlyMarkers...) diff --git a/pkg/crd/schema.go b/pkg/crd/schema.go index cc2adc758..a6e3cd601 100644 --- a/pkg/crd/schema.go +++ b/pkg/crd/schema.go @@ -128,16 +128,23 @@ func infoToSchema(ctx *schemaContext) *apiext.JSONSchemaProps { // applyMarkers applies schema markers given their priority to the given schema func applyMarkers(ctx *schemaContext, markerSet markers.MarkerValues, props *apiext.JSONSchemaProps, node ast.Node) { markers := make([]SchemaMarker, 0, len(markerSet)) + itemsMarkers := make([]SchemaMarker, 0, len(markerSet)) + itemsMarkerNames := make(map[SchemaMarker]string) - for _, markerValues := range markerSet { + for markerName, markerValues := range markerSet { for _, markerValue := range markerValues { if schemaMarker, isSchemaMarker := markerValue.(SchemaMarker); isSchemaMarker { - markers = append(markers, schemaMarker) + if strings.HasPrefix(markerName, crdmarkers.ValidationItemsPrefix) { + itemsMarkers = append(itemsMarkers, schemaMarker) + itemsMarkerNames[schemaMarker] = markerName + } else { + markers = append(markers, schemaMarker) + } } } } - sort.Slice(markers, func(i, j int) bool { + cmpPriority := func(markers []SchemaMarker, i, j int) bool { var iPriority, jPriority crdmarkers.ApplyPriority switch m := markers[i].(type) { @@ -159,13 +166,27 @@ func applyMarkers(ctx *schemaContext, markerSet markers.MarkerValues, props *api } return iPriority < jPriority - }) + } + sort.Slice(markers, func(i, j int) bool { return cmpPriority(markers, i, j) }) + sort.Slice(itemsMarkers, func(i, j int) bool { return cmpPriority(itemsMarkers, i, j) }) for _, schemaMarker := range markers { if err := schemaMarker.ApplyToSchema(props); err != nil { ctx.pkg.AddError(loader.ErrFromNode(err /* an okay guess */, node)) } } + + for _, schemaMarker := range itemsMarkers { + if props.Type != "array" || props.Items == nil || props.Items.Schema == nil { + err := fmt.Errorf("must apply %s to an array value, found %s", itemsMarkerNames[schemaMarker], props.Type) + ctx.pkg.AddError(loader.ErrFromNode(err, node)) + } else { + itemsSchema := props.Items.Schema + if err := schemaMarker.ApplyToSchema(itemsSchema); err != nil { + ctx.pkg.AddError(loader.ErrFromNode(err /* an okay guess */, node)) + } + } + } } // typeToSchema creates a schema for the given AST type. diff --git a/pkg/crd/testdata/cronjob_types.go b/pkg/crd/testdata/cronjob_types.go index d36beeab2..9f2eae271 100644 --- a/pkg/crd/testdata/cronjob_types.go +++ b/pkg/crd/testdata/cronjob_types.go @@ -197,7 +197,7 @@ type CronJobSpec struct { // This tests that an IntOrString can also have a pattern attached // to it. - // This can be useful if you want to limit the string to a perecentage or integer. + // This can be useful if you want to limit the string to a percentage or integer. // The XIntOrString marker is a requirement for having a pattern on this type. // +kubebuilder:validation:XIntOrString // +kubebuilder:validation:Pattern="^((100|[0-9]{1,2})%|[0-9]+)$" @@ -252,6 +252,32 @@ type CronJobSpec struct { // Checks that arrays work when the type contains a composite literal ArrayUsingCompositeLiteral [len(struct{ X [3]int }{}.X)]string `json:"arrayUsingCompositeLiteral,omitempty"` + + // This tests string slice item validation. + // +kubebuilder:validation:MinItems=1 + // +kubebuilder:validation:items:MinLength=1 + // +kubebuilder:validation:items:MaxLength=255 + // +kubebuilder:validation:items:Pattern=^[a-z0-9]([-a-z0-9]*[a-z0-9])?([.][a-z0-9]([-a-z0-9]*[a-z0-9])?)*$ + // +listType=set + Hosts []string `json:"hosts,omitempty"` + + HostsAlias Hosts `json:"hostsAlias,omitempty"` + + // This tests string slice validation. + // +kubebuilder:validation:MinItems=2 + // +kubebuilder:validation:MaxItems=2 + StringPair []string `json:"stringPair"` + + // This tests string alias slice item validation. + // +kubebuilder:validation:MinItems=3 + LongerStringArray []LongerString `json:"longerStringArray,omitempty"` + + // This tests that a slice of IntOrString can also have a pattern attached to it. + // This can be useful if you want to limit the string to a percentage or integer. + // The XIntOrString marker is a requirement for having a pattern on this type. + // +kubebuilder:validation:items:XIntOrString + // +kubebuilder:validation:items:Pattern="^((100|[0-9]{1,2})%|[0-9]+)$" + IntOrStringArrayWithAPattern []*intstr.IntOrString `json:"intOrStringArrayWithAPattern,omitempty"` } type ContainsNestedMap struct { @@ -360,6 +386,14 @@ type LongerString string // TotallyABool is a bool that serializes as a string. type TotallyABool bool +// This tests string slice item validation. +// +kubebuilder:validation:MinItems=1 +// +kubebuilder:validation:items:MinLength=1 +// +kubebuilder:validation:items:MaxLength=255 +// +kubebuilder:validation:items:Pattern=^[a-z0-9]([-a-z0-9]*[a-z0-9])?([.][a-z0-9]([-a-z0-9]*[a-z0-9])?)*$ +// +listType=set +type Hosts []string + func (t TotallyABool) MarshalJSON() ([]byte, error) { if t { return []byte(`"true"`), nil diff --git a/pkg/crd/testdata/testdata.kubebuilder.io_cronjobs.yaml b/pkg/crd/testdata/testdata.kubebuilder.io_cronjobs.yaml index 83d11978b..b72ca0bd6 100644 --- a/pkg/crd/testdata/testdata.kubebuilder.io_cronjobs.yaml +++ b/pkg/crd/testdata/testdata.kubebuilder.io_cronjobs.yaml @@ -196,12 +196,44 @@ spec: description: This tests that exported fields are not skipped in the schema generation type: string + hosts: + description: This tests string slice item validation. + items: + maxLength: 255 + minLength: 1 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?([.][a-z0-9]([-a-z0-9]*[a-z0-9])?)*$ + type: string + minItems: 1 + type: array + x-kubernetes-list-type: set + hostsAlias: + description: This tests string slice item validation. + items: + maxLength: 255 + minLength: 1 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?([.][a-z0-9]([-a-z0-9]*[a-z0-9])?)*$ + type: string + minItems: 1 + type: array + x-kubernetes-list-type: set int32WithValidations: format: int32 maximum: 2 minimum: -2 multipleOf: 2 type: integer + intOrStringArrayWithAPattern: + description: |- + This tests that a slice of IntOrString can also have a pattern attached to it. + This can be useful if you want to limit the string to a percentage or integer. + The XIntOrString marker is a requirement for having a pattern on this type. + items: + anyOf: + - type: integer + - type: string + pattern: ^((100|[0-9]{1,2})%|[0-9]+)$ + x-kubernetes-int-or-string: true + type: array intOrStringWithAPattern: anyOf: - type: integer @@ -209,7 +241,7 @@ spec: description: |- This tests that an IntOrString can also have a pattern attached to it. - This can be useful if you want to limit the string to a perecentage or integer. + This can be useful if you want to limit the string to a percentage or integer. The XIntOrString marker is a requirement for having a pattern on this type. pattern: ^((100|[0-9]{1,2})%|[0-9]+)$ x-kubernetes-int-or-string: true @@ -6609,6 +6641,15 @@ spec: - bar - foo type: object + longerStringArray: + description: This tests string alias slice item validation. + items: + description: This tests that markers that are allowed on both fields + and types are applied to types + minLength: 4 + type: string + minItems: 3 + type: array mapOfArraysOfFloats: additionalProperties: items: @@ -6742,6 +6783,13 @@ spec: time for any reason. Missed jobs executions will be counted as failed ones. format: int64 type: integer + stringPair: + description: This tests string slice validation. + items: + type: string + maxItems: 2 + minItems: 2 + type: array stringSliceData: additionalProperties: items: @@ -6839,6 +6887,7 @@ spec: - nestedassociativeList - patternObject - schedule + - stringPair - structWithSeveralFields - twoOfAKindPart0 - twoOfAKindPart1 From 3635bff3481f7a7f74cbc5cfb03e675f77068e49 Mon Sep 17 00:00:00 2001 From: Stefan Bueringer Date: Wed, 3 Apr 2024 16:44:25 +0200 Subject: [PATCH 10/33] Bump k/k to v1.30.0-rc.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Stefan Büringer buringerst@vmware.com --- go.mod | 12 ++++++------ go.sum | 20 ++++++++++---------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/go.mod b/go.mod index c5cb6aeb7..dafc35d82 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module sigs.k8s.io/controller-tools -go 1.21 +go 1.22.0 require ( github.com/fatih/color v1.16.0 @@ -13,15 +13,15 @@ require ( golang.org/x/tools v0.19.0 gopkg.in/yaml.v2 v2.4.0 gopkg.in/yaml.v3 v3.0.1 - k8s.io/api v0.29.0 - k8s.io/apiextensions-apiserver v0.29.0 - k8s.io/apimachinery v0.29.0 + k8s.io/api v0.30.0-rc.1 + k8s.io/apiextensions-apiserver v0.30.0-rc.1 + k8s.io/apimachinery v0.30.0-rc.1 sigs.k8s.io/yaml v1.4.0 ) require ( github.com/fsnotify/fsnotify v1.7.0 // indirect - github.com/go-logr/logr v1.3.0 // indirect + github.com/go-logr/logr v1.4.1 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/google/gofuzz v1.2.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect @@ -37,7 +37,7 @@ require ( golang.org/x/text v0.14.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect - k8s.io/klog/v2 v2.110.1 // indirect + k8s.io/klog/v2 v2.120.1 // indirect k8s.io/utils v0.0.0-20230726121419-3b25d923346b // indirect sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect diff --git a/go.sum b/go.sum index 01e69fef1..7468ca330 100644 --- a/go.sum +++ b/go.sum @@ -8,8 +8,8 @@ github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMo github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= -github.com/go-logr/logr v1.3.0 h1:2y3SDp0ZXuc6/cjLSZ+Q3ir+QB9T/iG5yYRXqsagWSY= -github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= +github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls= @@ -164,14 +164,14 @@ gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -k8s.io/api v0.29.0 h1:NiCdQMY1QOp1H8lfRyeEf8eOwV6+0xA6XEE44ohDX2A= -k8s.io/api v0.29.0/go.mod h1:sdVmXoz2Bo/cb77Pxi71IPTSErEW32xa4aXwKH7gfBA= -k8s.io/apiextensions-apiserver v0.29.0 h1:0VuspFG7Hj+SxyF/Z/2T0uFbI5gb5LRgEyUVE3Q4lV0= -k8s.io/apiextensions-apiserver v0.29.0/go.mod h1:TKmpy3bTS0mr9pylH0nOt/QzQRrW7/h7yLdRForMZwc= -k8s.io/apimachinery v0.29.0 h1:+ACVktwyicPz0oc6MTMLwa2Pw3ouLAfAon1wPLtG48o= -k8s.io/apimachinery v0.29.0/go.mod h1:eVBxQ/cwiJxH58eK/jd/vAk4mrxmVlnpBH5J2GbMeis= -k8s.io/klog/v2 v2.110.1 h1:U/Af64HJf7FcwMcXyKm2RPM22WZzyR7OSpYj5tg3cL0= -k8s.io/klog/v2 v2.110.1/go.mod h1:YGtd1984u+GgbuZ7e08/yBuAfKLSO0+uR1Fhi6ExXjo= +k8s.io/api v0.30.0-rc.1 h1:0163kmXvT0JoER+nh9h1nSgX+sDwYYHPBgs+rWqjVIg= +k8s.io/api v0.30.0-rc.1/go.mod h1:mfiQxBiaioCBgc+jzmDpSXmSEQkqeHTh4FVOAh1iEqU= +k8s.io/apiextensions-apiserver v0.30.0-rc.1 h1:RNfnKYPwdIZ+nBTUTeprdBzL2WVH0xn5BsLVeaUuHDA= +k8s.io/apiextensions-apiserver v0.30.0-rc.1/go.mod h1:8bhW7JKTNgvFkBrTbqyBQq3Sme1CwWjyEkt4pxf01Nc= +k8s.io/apimachinery v0.30.0-rc.1 h1:Zi5mcxPCvhwJL8S8tNC5AakszlABd3UWr6OOXqPDToM= +k8s.io/apimachinery v0.30.0-rc.1/go.mod h1:wEJvNDlfxMRaMhyv38SIHIEC9hah/xuzqUUhxIyUv7Y= +k8s.io/klog/v2 v2.120.1 h1:QXU6cPEOIslTGvZaXvFWiP9VKyeet3sawzTOvdXb4Vw= +k8s.io/klog/v2 v2.120.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= k8s.io/utils v0.0.0-20230726121419-3b25d923346b h1:sgn3ZU783SCgtaSJjpcVVlRqd6GSnlTLKgpAAttJvpI= k8s.io/utils v0.0.0-20230726121419-3b25d923346b/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= From 4482e547f8df8d0e53bde1e931a3d1afcbcb5602 Mon Sep 17 00:00:00 2001 From: Stefan Bueringer Date: Wed, 3 Apr 2024 17:34:38 +0200 Subject: [PATCH 11/33] Bump golangci-lint to v1.57.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Stefan Büringer buringerst@vmware.com --- .golangci.yml | 9 ++++++++- pkg/loader/refs.go | 3 +-- test.sh | 3 +-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 3a3f0f04c..d3f395402 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -2,4 +2,11 @@ run: modules-download-mode: readonly # Increase the default deadline from 1m as some module operations can take a # while if uncached! - deadline: 5m + timeout: 10m + +issues: + exclude-rules: + # Dot imports for gomega and ginkgo are allowed + # within test files. + - path: _test\.go + text: should not use dot imports diff --git a/pkg/loader/refs.go b/pkg/loader/refs.go index 37c3295f1..f58a29f72 100644 --- a/pkg/loader/refs.go +++ b/pkg/loader/refs.go @@ -18,7 +18,6 @@ package loader import ( "fmt" - "go/ast" "strconv" "sync" @@ -164,7 +163,7 @@ func allReferencedPackages(pkg *Package, filterNodes NodeFilter) []*Package { refsByFile[file] = refs } - EachType(pkg, func(file *ast.File, decl *ast.GenDecl, spec *ast.TypeSpec) { + EachType(pkg, func(file *ast.File, _ *ast.GenDecl, spec *ast.TypeSpec) { refs := refsByFile[file] refs.collectReferences(spec.Type, filterNodes) }) diff --git a/test.sh b/test.sh index fdb289abd..a57bc6031 100755 --- a/test.sh +++ b/test.sh @@ -100,7 +100,7 @@ function setup_envs { header_text "using tools" if ! which golangci-lint 2>&1 >/dev/null; then - curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.52.2 + curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.57.2 export PATH=$PATH:$(go env GOPATH)/bin fi @@ -132,7 +132,6 @@ golangci-lint run --disable-all \ --enable=gocyclo \ --enable=gosec \ --enable=gofmt \ - --deadline=5m \ ./pkg/... ./cmd/... # --enable=structcheck \ # doesn't understand embedded structs From 76b24b2709ba146f7794941ac0cdcb437144f64a Mon Sep 17 00:00:00 2001 From: Vince Prignano Date: Fri, 5 Apr 2024 08:55:03 -0700 Subject: [PATCH 12/33] :seedling: Update golangci-lint, Makefile, Actions Signed-off-by: Vince Prignano --- .github/dependabot.yml | 7 ++- .github/workflows/golangci-lint.yml | 37 +++++++++++ .github/workflows/pr-dependabot.yaml | 35 +++++++++++ .github/workflows/verify.yml | 9 +-- .gitignore | 6 ++ Makefile | 93 +++++++++++++++++++++++++++- hack/go-install.sh | 45 ++++++++++++++ hack/tools/.keep | 0 pkg/crd/gen.go | 7 +-- pkg/deepcopy/gen.go | 1 - pkg/genall/options.go | 1 - pkg/loader/loader.go | 3 - pkg/markers/collect.go | 1 - pkg/rbac/parser.go | 1 - pkg/schemapatcher/gen.go | 2 +- pkg/typescaffold/resource.go | 2 +- pkg/version/version.go | 2 + pkg/webhook/parser.go | 3 +- test.sh | 23 +------ 19 files changed, 233 insertions(+), 45 deletions(-) create mode 100644 .github/workflows/golangci-lint.yml create mode 100644 .github/workflows/pr-dependabot.yaml create mode 100755 hack/go-install.sh create mode 100644 hack/tools/.keep diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 312fc6ba4..4af948c5e 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -25,10 +25,13 @@ updates: interval: "weekly" commit-message: prefix: ":seedling:" - labels: - - "ok-to-test" # Ignore K8 packages as these are done manually ignore: - dependency-name: "k8s.io/api" - dependency-name: "k8s.io/apiextensions-apiserver" - dependency-name: "k8s.io/apimachinery" + - dependency-name: "k8s.io/client-go" + - dependency-name: "k8s.io/component-base" + labels: + - "ok-to-test" + diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml new file mode 100644 index 000000000..7baade1aa --- /dev/null +++ b/.github/workflows/golangci-lint.yml @@ -0,0 +1,37 @@ +name: golangci-lint +on: + pull_request: + types: [opened, edited, synchronize, reopened] + branches: + - main + +permissions: + # Required: allow read access to the content for analysis. + contents: read + # Optional: allow read access to pull request. Use with `only-new-issues` option. + pull-requests: read + # Optional: Allow write access to checks to allow the action to annotate code in the PR. + checks: write + +jobs: + golangci: + name: lint + runs-on: ubuntu-latest + strategy: + matrix: + working-directory: + - "" + - tools/setup-envtest + steps: + - name: Set up Go + uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # tag=v5.0.0 + with: + go-version: "1.22" + cache: false + - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # tag=v4.1.2 + - name: golangci-lint + uses: golangci/golangci-lint-action@3cfe3a4abbb849e10058ce4af15d205b6da42804 # tag=v4.0.0 + with: + version: v1.57.2 + args: --out-format=colored-line-number + working-directory: ${{matrix.working-directory}} diff --git a/.github/workflows/pr-dependabot.yaml b/.github/workflows/pr-dependabot.yaml new file mode 100644 index 000000000..c5e7d6d80 --- /dev/null +++ b/.github/workflows/pr-dependabot.yaml @@ -0,0 +1,35 @@ +name: PR dependabot go modules fix + +# This action runs on PRs opened by dependabot and updates modules. +on: + pull_request: + branches: + - dependabot/** + push: + branches: + - dependabot/** + workflow_dispatch: + +permissions: + contents: write # Allow to update the PR. + +jobs: + build: + name: Build + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # tag=v4.1.2 + - name: Set up Go + uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # tag=v5.0.0 + with: + go-version: '1.22' + - name: Update all modules + run: make modules + - uses: EndBug/add-and-commit@a94899bca583c204427a224a7af87c02f9b325d5 # tag=v9.1.4 + name: Commit changes + with: + author_name: dependabot[bot] + author_email: 49699333+dependabot[bot]@users.noreply.github.com + default_author: github_actor + message: 'Update generated code' diff --git a/.github/workflows/verify.yml b/.github/workflows/verify.yml index 74c59a6c6..e24f96210 100644 --- a/.github/workflows/verify.yml +++ b/.github/workflows/verify.yml @@ -1,8 +1,9 @@ -name: PR Verifier - on: pull_request_target: - types: [opened, edited, reopened] + types: [opened, edited, reopened, synchronize] + +permissions: + checks: write # Allow access to checks to write check runs. jobs: verify: @@ -11,6 +12,6 @@ jobs: steps: - name: Verifier action id: verifier - uses: kubernetes-sigs/kubebuilder-release-tools@v0.4.3 + uses: kubernetes-sigs/kubebuilder-release-tools@012269a88fa4c034a0acf1ba84c26b195c0dbab4 # tag=v0.4.3 with: github_token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore index 9e0c605fc..7a427bdbe 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,9 @@ *.swp *.swo *~ + +# Tools binaries. +hack/tools/bin + +junit-report.xml +/artifacts diff --git a/Makefile b/Makefile index 107e7d201..6bc225d3f 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,94 @@ -test-all: +#!/usr/bin/env bash + +# Copyright 2024 The Kubernetes Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# If you update this file, please follow +# https://suva.sh/posts/well-documented-makefiles + +## -------------------------------------- +## General +## -------------------------------------- + +SHELL:=/usr/bin/env bash +.DEFAULT_GOAL:=help + +# Use GOPROXY environment variable if set +GOPROXY := $(shell go env GOPROXY) +ifeq ($(GOPROXY),) +GOPROXY := https://proxy.golang.org +endif +export GOPROXY + +# Active module mode, as we use go modules to manage dependencies +export GO111MODULE=on + +# Tools. +TOOLS_DIR := hack/tools +TOOLS_BIN_DIR := $(abspath $(TOOLS_DIR)/bin) +GOLANGCI_LINT := $(abspath $(TOOLS_BIN_DIR)/golangci-lint) +GO_INSTALL := ./hack/go-install.sh + +## -------------------------------------- +## Binaries +## -------------------------------------- + +GOLANGCI_LINT_BIN := golangci-lint +GOLANGCI_LINT_VER := $(shell cat .github/workflows/golangci-lint.yml | grep [[:space:]]version: | sed 's/.*version: //') +GOLANGCI_LINT := $(abspath $(TOOLS_BIN_DIR)/$(GOLANGCI_LINT_BIN)-$(GOLANGCI_LINT_VER)) +GOLANGCI_LINT_PKG := github.com/golangci/golangci-lint/cmd/golangci-lint + +$(GOLANGCI_LINT): # Build golangci-lint from tools folder. + GOBIN=$(TOOLS_BIN_DIR) $(GO_INSTALL) $(GOLANGCI_LINT_PKG) $(GOLANGCI_LINT_BIN) $(GOLANGCI_LINT_VER) + +## -------------------------------------- +## Linting +## -------------------------------------- + +.PHONY: lint +lint: $(GOLANGCI_LINT) ## Lint codebase + $(GOLANGCI_LINT) run -v $(GOLANGCI_LINT_EXTRA_ARGS) + cd tools/setup-envtest; $(GOLANGCI_LINT) run -v $(GOLANGCI_LINT_EXTRA_ARGS) + +.PHONY: lint-fix +lint-fix: $(GOLANGCI_LINT) ## Lint the codebase and run auto-fixers if supported by the linter. + GOLANGCI_LINT_EXTRA_ARGS=--fix $(MAKE) lint + +## -------------------------------------- +## Testing +## -------------------------------------- + +.PHONY: test +test: ## Run the test.sh script which will check all. TRACE=1 ./test.sh -generate-modules: +test-all: + $(MAKE) test + +.PHONY: modules +modules: ## Runs go mod to ensure modules are up to date. go mod tidy + +## -------------------------------------- +## Cleanup / Verification +## -------------------------------------- + +.PHONY: clean +clean: ## Cleanup. + $(GOLANGCI_LINT) cache clean + $(MAKE) clean-bin + +.PHONY: clean-bin +clean-bin: ## Remove all generated binaries. + rm -rf hack/tools/bin diff --git a/hack/go-install.sh b/hack/go-install.sh new file mode 100755 index 000000000..a07b8e0f1 --- /dev/null +++ b/hack/go-install.sh @@ -0,0 +1,45 @@ +#!/usr/bin/env bash +# Copyright 2021 The Kubernetes Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -o errexit +set -o nounset +set -o pipefail + +if [ -z "${1}" ]; then + echo "must provide module as first parameter" + exit 1 +fi + +if [ -z "${2}" ]; then + echo "must provide binary name as second parameter" + exit 1 +fi + +if [ -z "${3}" ]; then + echo "must provide version as third parameter" + exit 1 +fi + +if [ -z "${GOBIN}" ]; then + echo "GOBIN is not set. Must set GOBIN to install the bin in a specified directory." + exit 1 +fi + +rm -f "${GOBIN}/${2}"* || true + +# install the golang module specified as the first argument +go install "${1}@${3}" +mv "${GOBIN}/${2}" "${GOBIN}/${2}-${3}" +ln -sf "${GOBIN}/${2}-${3}" "${GOBIN}/${2}" diff --git a/hack/tools/.keep b/hack/tools/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/crd/gen.go b/pkg/crd/gen.go index 546ba9a6d..9eb4126bc 100644 --- a/pkg/crd/gen.go +++ b/pkg/crd/gen.go @@ -105,10 +105,10 @@ func (g Generator) Generate(ctx *genall.GenerationContext) error { Collector: ctx.Collector, Checker: ctx.Checker, // Perform defaulting here to avoid ambiguity later - IgnoreUnexportedFields: g.IgnoreUnexportedFields != nil && *g.IgnoreUnexportedFields == true, - AllowDangerousTypes: g.AllowDangerousTypes != nil && *g.AllowDangerousTypes == true, + IgnoreUnexportedFields: g.IgnoreUnexportedFields != nil && *g.IgnoreUnexportedFields, + AllowDangerousTypes: g.AllowDangerousTypes != nil && *g.AllowDangerousTypes, // Indicates the parser on whether to register the ObjectMeta type or not - GenerateEmbeddedObjectMeta: g.GenerateEmbeddedObjectMeta != nil && *g.GenerateEmbeddedObjectMeta == true, + GenerateEmbeddedObjectMeta: g.GenerateEmbeddedObjectMeta != nil && *g.GenerateEmbeddedObjectMeta, } AddKnownTypes(parser) @@ -194,7 +194,6 @@ func removeDescriptionFromMetadataProps(v *apiext.JSONSchemaProps) { if meta.Description != "" { meta.Description = "" v.Properties["metadata"] = m - } } } diff --git a/pkg/deepcopy/gen.go b/pkg/deepcopy/gen.go index c1d3b708c..a85cc8577 100644 --- a/pkg/deepcopy/gen.go +++ b/pkg/deepcopy/gen.go @@ -191,7 +191,6 @@ import ( if err != nil { pkg.AddError(err) } - } // generateForPackage generates DeepCopy and runtime.Object implementations for diff --git a/pkg/genall/options.go b/pkg/genall/options.go index 658b96bb3..97d7d67a6 100644 --- a/pkg/genall/options.go +++ b/pkg/genall/options.go @@ -74,7 +74,6 @@ func RegistryFromOptions(optionsRegistry *markers.Registry, options []string) (* // further modified. Not default generators are used if none are specified -- you can check // the output and rerun for that. func FromOptions(optionsRegistry *markers.Registry, options []string) (*Runtime, error) { - protoRt, err := protoFromOptions(optionsRegistry, options) if err != nil { return nil, err diff --git a/pkg/loader/loader.go b/pkg/loader/loader.go index f272aaae2..2c5cf4c97 100644 --- a/pkg/loader/loader.go +++ b/pkg/loader/loader.go @@ -489,7 +489,6 @@ func LoadRootsWithConfig(cfg *packages.Config, roots ...string) ([]*Package, err p string, d os.DirEntry, e error) error { - if e != nil { return e } @@ -518,7 +517,6 @@ func LoadRootsWithConfig(cfg *packages.Config, roots ...string) ([]*Package, err // get the absolute path of the root if !filepath.IsAbs(r) { - // if the initial value of cfg.Dir was non-empty then use it when // building the absolute path to this root. otherwise use the // filepath.Abs function to get the absolute path of the root based @@ -548,7 +546,6 @@ func LoadRootsWithConfig(cfg *packages.Config, roots ...string) ([]*Package, err if err := filepath.WalkDir( d, addNestedGoModulesToRoots); err != nil { - return nil, err } } diff --git a/pkg/markers/collect.go b/pkg/markers/collect.go index 63aa7344b..23f52e3d2 100644 --- a/pkg/markers/collect.go +++ b/pkg/markers/collect.go @@ -388,7 +388,6 @@ func (v markerSubVisitor) Visit(node ast.Node) ast.Visitor { v.commentInd = lastCommentInd + 1 return resVisitor - } // associatedCommentsFor returns the doc comment group (if relevant and present) and end-of-line comment diff --git a/pkg/rbac/parser.go b/pkg/rbac/parser.go index c8bbe9d54..50bdf322c 100644 --- a/pkg/rbac/parser.go +++ b/pkg/rbac/parser.go @@ -210,7 +210,6 @@ func GenerateRoles(ctx *genall.GenerationContext, roleName string) ([]interface{ var policyRules []rbacv1.PolicyRule for _, key := range keys { policyRules = append(policyRules, ruleMap[key].ToRule()) - } return policyRules } diff --git a/pkg/schemapatcher/gen.go b/pkg/schemapatcher/gen.go index 8080aeae7..9e5a85131 100644 --- a/pkg/schemapatcher/gen.go +++ b/pkg/schemapatcher/gen.go @@ -92,7 +92,7 @@ func (g Generator) Generate(ctx *genall.GenerationContext) (result error) { Collector: ctx.Collector, Checker: ctx.Checker, // Indicates the parser on whether to register the ObjectMeta type or not - GenerateEmbeddedObjectMeta: g.GenerateEmbeddedObjectMeta != nil && *g.GenerateEmbeddedObjectMeta == true, + GenerateEmbeddedObjectMeta: g.GenerateEmbeddedObjectMeta != nil && *g.GenerateEmbeddedObjectMeta, } crdgen.AddKnownTypes(parser) diff --git a/pkg/typescaffold/resource.go b/pkg/typescaffold/resource.go index e4c2388ac..7024a7c8a 100644 --- a/pkg/typescaffold/resource.go +++ b/pkg/typescaffold/resource.go @@ -46,7 +46,7 @@ func (r *Resource) Validate() error { } if r.Kind != flect.Pascalize(r.Kind) { - return fmt.Errorf("Kind must be camelcase (expected %s was %s)", flect.Pascalize(r.Kind), r.Kind) + return fmt.Errorf("kind must be CamelCase (expected %s was %s)", flect.Pascalize(r.Kind), r.Kind) } return nil diff --git a/pkg/version/version.go b/pkg/version/version.go index 09c8efcf4..f2709df4a 100644 --- a/pkg/version/version.go +++ b/pkg/version/version.go @@ -13,6 +13,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ + +// Package version provides the version of the main module. package version import ( diff --git a/pkg/webhook/parser.go b/pkg/webhook/parser.go index 26d072920..5652b4c45 100644 --- a/pkg/webhook/parser.go +++ b/pkg/webhook/parser.go @@ -289,7 +289,6 @@ func (c Config) clientConfig() (admissionregv1.WebhookClientConfig, error) { return admissionregv1.WebhookClientConfig{ URL: &url, }, nil - } // sideEffects returns the sideEffects config for a webhook. @@ -486,7 +485,7 @@ func (g Generator) Generate(ctx *genall.GenerationContext) error { for k, v := range versionedWebhooks { var fileName string if k == defaultWebhookVersion { - fileName = fmt.Sprintf("manifests.yaml") + fileName = "manifests.yaml" } else { fileName = fmt.Sprintf("manifests.%s.yaml", k) } diff --git a/test.sh b/test.sh index a57bc6031..df668fd5d 100755 --- a/test.sh +++ b/test.sh @@ -99,11 +99,6 @@ function setup_envs { header_text "using tools" -if ! which golangci-lint 2>&1 >/dev/null; then - curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.57.2 - export PATH=$PATH:$(go env GOPATH)/bin -fi - # fetch the testing binaries - e.g. apiserver and etcd fetch_kb_tools @@ -116,23 +111,7 @@ pushd cmd/controller-gen > /dev/null popd > /dev/null header_text "running golangci-lint" - - -golangci-lint run --disable-all \ - --enable=misspell \ - --enable=revive \ - --enable=govet \ - --enable=unused \ - --enable=goimports \ - --enable=errcheck \ - --enable=unparam \ - --enable=ineffassign \ - --enable=nakedret \ - --enable=misspell \ - --enable=gocyclo \ - --enable=gosec \ - --enable=gofmt \ - ./pkg/... ./cmd/... +make lint # --enable=structcheck \ # doesn't understand embedded structs # --enable=goconst \ # complains about constants that shouldn't be constants From de0846902b4aa3d88d4cc6947df2aca5004a5c19 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 5 Apr 2024 17:07:11 +0000 Subject: [PATCH 13/33] :seedling: Bump golang.org/x/tools from 0.19.0 to 0.20.0 Bumps [golang.org/x/tools](https://github.com/golang/tools) from 0.19.0 to 0.20.0. - [Release notes](https://github.com/golang/tools/releases) - [Commits](https://github.com/golang/tools/compare/v0.19.0...v0.20.0) --- updated-dependencies: - dependency-name: golang.org/x/tools dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 9 +++++---- go.sum | 20 ++++++++++---------- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/go.mod b/go.mod index dafc35d82..259476dfe 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/onsi/gomega v1.32.0 github.com/spf13/cobra v1.8.0 github.com/spf13/pflag v1.0.5 - golang.org/x/tools v0.19.0 + golang.org/x/tools v0.20.0 gopkg.in/yaml.v2 v2.4.0 gopkg.in/yaml.v3 v3.0.1 k8s.io/api v0.30.0-rc.1 @@ -31,9 +31,10 @@ require ( github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/nxadm/tail v1.4.8 // indirect - golang.org/x/mod v0.16.0 // indirect - golang.org/x/net v0.22.0 // indirect - golang.org/x/sys v0.18.0 // indirect + golang.org/x/mod v0.17.0 // indirect + golang.org/x/net v0.24.0 // indirect + golang.org/x/sync v0.7.0 // indirect + golang.org/x/sys v0.19.0 // indirect golang.org/x/text v0.14.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect diff --git a/go.sum b/go.sum index 7468ca330..ebae33186 100644 --- a/go.sum +++ b/go.sum @@ -95,22 +95,22 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.16.0 h1:QX4fJ0Rr5cPQCF7O9lh9Se4pmwfwskqZfq5moyldzic= -golang.org/x/mod v0.16.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA= +golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.22.0 h1:9sGLhx7iRIHEiX0oAJ3MRZMUCElJgy7Br1nO+AMN3Tc= -golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= +golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= +golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= -golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -122,8 +122,8 @@ golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= -golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= +golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= @@ -133,8 +133,8 @@ golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.19.0 h1:tfGCXNR1OsFG+sVdLAitlpjAvD/I6dHDKnYrpEZUHkw= -golang.org/x/tools v0.19.0/go.mod h1:qoJWxmGSIBmAeriMx19ogtrEPrGtDbPK634QFIcLAhc= +golang.org/x/tools v0.20.0 h1:hz/CVckiOxybQvFw6h7b/q80NTr9IUQb4s1IIzW7KNY= +golang.org/x/tools v0.20.0/go.mod h1:WvitBU7JJf6A4jOdg4S1tviW9bhUxkgeCui/0JHctQg= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= From d64674f684ebf9290f189b84b48cac338e5e585b Mon Sep 17 00:00:00 2001 From: Vince Prignano Date: Fri, 5 Apr 2024 09:21:45 -0700 Subject: [PATCH 14/33] :sparkles: Build and publish Kubernetes envtest tools as packages Signed-off-by: Vince Prignano --- .github/workflows/tools-releases.yml | 79 ++++++++++++++++++++++++++++ hack/envtest/_matrix/v1.28.0.yaml | 2 + hack/envtest/_matrix/v1.29.3.yaml | 2 + hack/envtest/darwin/Dockerfile | 56 ++++++++++++++++++++ hack/envtest/linux/Dockerfile | 50 ++++++++++++++++++ hack/envtest/windows/Dockerfile | 56 ++++++++++++++++++++ 6 files changed, 245 insertions(+) create mode 100644 .github/workflows/tools-releases.yml create mode 100644 hack/envtest/_matrix/v1.28.0.yaml create mode 100644 hack/envtest/_matrix/v1.29.3.yaml create mode 100644 hack/envtest/darwin/Dockerfile create mode 100644 hack/envtest/linux/Dockerfile create mode 100644 hack/envtest/windows/Dockerfile diff --git a/.github/workflows/tools-releases.yml b/.github/workflows/tools-releases.yml new file mode 100644 index 000000000..8d0875e8f --- /dev/null +++ b/.github/workflows/tools-releases.yml @@ -0,0 +1,79 @@ +name: Package controller-runtime envtest + +on: + push: + branches: + - main + paths: + - 'hack/envtest/_matrix/*.yaml' + +permissions: + contents: read + packages: write + +jobs: + build-and-push: + runs-on: ubuntu-latest + strategy: + matrix: + os: + - linux + - darwin + arch: + - amd64 + - arm64 + include: + - arch: ppc64le + os: linux + - arch: s390x + os: linux + - arch: amd64 + os: windows + steps: + - name: Checkout code + uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # tag=v4.1.2 + - name: Get changed files + id: changed-files + uses: tj-actions/changed-files@2d756ea4c53f7f6b397767d8723b3a10a9f35bf2 # tag=v44.0.0 + with: + files: | + hack/envtest/_matrix/*.yaml + - name: Setup package release version + id: release-version + run: | + if [[ ${{ steps.changed-files.outputs.all_changed_files_count }} != 1 ]]; then + echo "One Kubernetes patch version files should be changed to create a package, found ${{ steps.changed-files.outputs.all_changed_files_count }}" + exit 1 + fi + for changed_file in ${{ steps.changed-files.outputs.all_changed_files }}; do + export KUBERNETES_VERSION=$(echo "${changed_file}" | grep -oP '(?<=/)[^/]+(?=\.yaml)') + echo "KUBERNETES_VERSION=$KUBERNETES_VERSION" >> $GITHUB_ENV + + GO_VERSION=$(yq eval '.go' $changed_file) + echo "GO_VERSION=$GO_VERSION" >> $GITHUB_ENV + + ETCD_VERSION=$(yq eval '.etcd' $changed_file) + echo "ETCD_VERSION=$ETCD_VERSION" >> $GITHUB_ENV + done + - name: Set up Docker + uses: docker/setup-buildx-action@2b51285047da1547ffb1b2203d8be4c0af6b1f20 # tag=v3.2.0 + - name: Log in to the Container registry + uses: docker/login-action@e92390c5fb421da1463c202d546fed0ec5c39f20 # tag=v3.1.0 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build and push Docker images + uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 # tag=v5.3.0 + with: + context: . + file: ./hack/envtest/${{matrix.os}}/Dockerfile + build-args: | + GO_VERSION=${{env.GO_VERSION}} + KUBERNETES_VERSION=${{env.KUBERNETES_VERSION}} + ETCD_VERSION=${{env.ETCD_VERSION}} + OS=${{matrix.os}} + ARCH=${{matrix.arch}} + push: true + tags: | + ghcr.io/kubernetes-sigs/controller-tools/envtest:${{env.KUBERNETES_VERSION}}-${{matrix.os}}-${{matrix.arch}} diff --git a/hack/envtest/_matrix/v1.28.0.yaml b/hack/envtest/_matrix/v1.28.0.yaml new file mode 100644 index 000000000..83bf3ddd8 --- /dev/null +++ b/hack/envtest/_matrix/v1.28.0.yaml @@ -0,0 +1,2 @@ +go: 1.21 +etcd: v3.5.9 diff --git a/hack/envtest/_matrix/v1.29.3.yaml b/hack/envtest/_matrix/v1.29.3.yaml new file mode 100644 index 000000000..d35406399 --- /dev/null +++ b/hack/envtest/_matrix/v1.29.3.yaml @@ -0,0 +1,2 @@ +go: 1.21 +etcd: v3.5.12 diff --git a/hack/envtest/darwin/Dockerfile b/hack/envtest/darwin/Dockerfile new file mode 100644 index 000000000..8adf45ace --- /dev/null +++ b/hack/envtest/darwin/Dockerfile @@ -0,0 +1,56 @@ +# Copyright 2018 The Kubernetes Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +ARG GO_VERSION +FROM golang:${GO_VERSION} as builder + +# Version and platform args. +ARG KUBERNETES_VERSION +ARG ETCD_VERSION +ARG OS=darwin +ARG ARCH + +# Tools path. +ENV DEST=/controller-tools/envtest + +# Install dependencies. +RUN apt update && \ + apt install unzip rsync -y && \ + mkdir -p $DEST + +# kube-apiserver +WORKDIR /kubernetes +RUN git clone https://github.com/kubernetes/kubernetes . --depth=1 -b ${KUBERNETES_VERSION} +ENV CGO_ENABLED=0 +ENV KUBE_BUILD_PLATFORMS=${OS}/${ARCH} +RUN make WHAT=cmd/kube-apiserver && \ + cp _output/local/bin/${KUBE_BUILD_PLATFORMS}/kube-apiserver $DEST + +# kubectl +RUN /bin/bash -x -c ' \ + { curl -sfLO https://storage.googleapis.com/kubernetes-release/release/${KUBERNETES_VERSION}/bin/${OS}/${ARCH}/kubectl && \ + chmod +x kubectl && \ + cp kubectl $DEST; } || \ + { make WHAT=cmd/kubectl && \ + cp _output/local/bin/${KUBE_BUILD_PLATFORMS}/kubectl $DEST; }' + +# etcd +ENV ETCD_BASE_NAME=etcd-${ETCD_VERSION}-${OS}-${ARCH} +RUN curl -sfLO https://github.com/coreos/etcd/releases/download/${ETCD_VERSION}/${ETCD_BASE_NAME}.zip && \ + unzip -o ${ETCD_BASE_NAME}.zip && \ + cp ${ETCD_BASE_NAME}/etcd $DEST + +# Build the final image with the binaries. +FROM scratch +COPY --from=builder /controller-tools/envtest /controller-tools/envtest diff --git a/hack/envtest/linux/Dockerfile b/hack/envtest/linux/Dockerfile new file mode 100644 index 000000000..d68072ec5 --- /dev/null +++ b/hack/envtest/linux/Dockerfile @@ -0,0 +1,50 @@ +# Copyright 2018 The Kubernetes Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +ARG GO_VERSION +FROM golang:${GO_VERSION} as builder + +# Version and platform args. +ARG KUBERNETES_VERSION +ARG ETCD_VERSION +ARG OS=linux +ARG ARCH + +# Tools path. +ENV DEST=/controller-tools/envtest + +# Install dependencies. +RUN apt update && \ + apt install unzip rsync -y && \ + mkdir -p $DEST + +# kube-apiserver +RUN curl -sfLO https://dl.k8s.io/${KUBERNETES_VERSION}/bin/${OS}/${ARCH}/kube-apiserver && \ + chmod +x kube-apiserver && \ + cp kube-apiserver $DEST + +# kubectl +RUN curl -sfLO https://storage.googleapis.com/kubernetes-release/release/${KUBERNETES_VERSION}/bin/${OS}/${ARCH}/kubectl && \ + chmod +x kubectl && \ + cp kubectl $DEST + +# etcd +ENV ETCD_BASE_NAME=etcd-${ETCD_VERSION}-${OS}-${ARCH} +RUN curl -sfLO https://github.com/coreos/etcd/releases/download/${ETCD_VERSION}/${ETCD_BASE_NAME}.tar.gz && \ + tar xzf ${ETCD_BASE_NAME}.tar.gz && \ + cp ${ETCD_BASE_NAME}/etcd $DEST + +# Build the final image with the binaries. +FROM scratch +COPY --from=builder /controller-tools/envtest /controller-tools/envtest diff --git a/hack/envtest/windows/Dockerfile b/hack/envtest/windows/Dockerfile new file mode 100644 index 000000000..a74a73c0d --- /dev/null +++ b/hack/envtest/windows/Dockerfile @@ -0,0 +1,56 @@ +# Copyright 2018 The Kubernetes Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +ARG GO_VERSION +FROM golang:${GO_VERSION} as builder + +# Version and platform args. +ARG KUBERNETES_VERSION +ARG ETCD_VERSION +ARG OS=windows +ARG ARCH + +# Tools path. +ENV DEST=/controller-tools/envtest + +# Install dependencies. +RUN apt update && \ + apt install unzip rsync -y && \ + mkdir -p $DEST + +# kube-apiserver +WORKDIR /kubernetes +RUN git clone https://github.com/kubernetes/kubernetes . --depth=1 -b ${KUBERNETES_VERSION} +ENV CGO_ENABLED=0 +ENV KUBE_BUILD_PLATFORMS=${OS}/${ARCH} +RUN make WHAT=cmd/kube-apiserver && \ + cp _output/local/bin/${KUBE_BUILD_PLATFORMS}/kube-apiserver.exe $DEST + +# kubectl +RUN /bin/bash -x -c ' \ + { curl -sfLO https://storage.googleapis.com/kubernetes-release/release/${KUBERNETES_VERSION}/bin/${OS}/${ARCH}/kubectl.exe && \ + chmod +x kubectl.exe && \ + cp kubectl.exe $DEST; } || \ + { make WHAT=cmd/kubectl && \ + cp _output/local/bin/${KUBE_BUILD_PLATFORMS}/kubectl.exe $DEST; }' + +# etcd +ENV ETCD_BASE_NAME=etcd-${ETCD_VERSION}-${OS}-${ARCH} +RUN curl -sfLO https://github.com/coreos/etcd/releases/download/${ETCD_VERSION}/${ETCD_BASE_NAME}.zip && \ + unzip -o ${ETCD_BASE_NAME}.zip && \ + cp ${ETCD_BASE_NAME}/etcd.exe $DEST + +# Build the final image with the binaries. +FROM scratch +COPY --from=builder /controller-tools/envtest /controller-tools/envtest From c912289feb2e3f12ff3cc716f0543472ae902dc7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Apr 2024 01:37:13 +0000 Subject: [PATCH 15/33] :seedling: Bump docker/setup-buildx-action from 3.2.0 to 3.3.0 Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 3.2.0 to 3.3.0. - [Release notes](https://github.com/docker/setup-buildx-action/releases) - [Commits](https://github.com/docker/setup-buildx-action/compare/2b51285047da1547ffb1b2203d8be4c0af6b1f20...d70bba72b1f3fd22344832f00baa16ece964efeb) --- updated-dependencies: - dependency-name: docker/setup-buildx-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/tools-releases.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tools-releases.yml b/.github/workflows/tools-releases.yml index 8d0875e8f..1670aaa25 100644 --- a/.github/workflows/tools-releases.yml +++ b/.github/workflows/tools-releases.yml @@ -56,7 +56,7 @@ jobs: echo "ETCD_VERSION=$ETCD_VERSION" >> $GITHUB_ENV done - name: Set up Docker - uses: docker/setup-buildx-action@2b51285047da1547ffb1b2203d8be4c0af6b1f20 # tag=v3.2.0 + uses: docker/setup-buildx-action@d70bba72b1f3fd22344832f00baa16ece964efeb # tag=v3.3.0 - name: Log in to the Container registry uses: docker/login-action@e92390c5fb421da1463c202d546fed0ec5c39f20 # tag=v3.1.0 with: From 36d39209c32726ff45a54dd637ae08d836581e50 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Apr 2024 01:37:24 +0000 Subject: [PATCH 16/33] :seedling: Bump tj-actions/changed-files from 44.0.0 to 44.0.1 Bumps [tj-actions/changed-files](https://github.com/tj-actions/changed-files) from 44.0.0 to 44.0.1. - [Release notes](https://github.com/tj-actions/changed-files/releases) - [Changelog](https://github.com/tj-actions/changed-files/blob/main/HISTORY.md) - [Commits](https://github.com/tj-actions/changed-files/compare/2d756ea4c53f7f6b397767d8723b3a10a9f35bf2...635f118699dd888d737c15018cd30aff2e0274f8) --- updated-dependencies: - dependency-name: tj-actions/changed-files dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/tools-releases.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tools-releases.yml b/.github/workflows/tools-releases.yml index 8d0875e8f..306b9e133 100644 --- a/.github/workflows/tools-releases.yml +++ b/.github/workflows/tools-releases.yml @@ -34,7 +34,7 @@ jobs: uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # tag=v4.1.2 - name: Get changed files id: changed-files - uses: tj-actions/changed-files@2d756ea4c53f7f6b397767d8723b3a10a9f35bf2 # tag=v44.0.0 + uses: tj-actions/changed-files@635f118699dd888d737c15018cd30aff2e0274f8 # tag=v44.0.1 with: files: | hack/envtest/_matrix/*.yaml From 6c89b51cdc6142deff738827652b42c88621c4de Mon Sep 17 00:00:00 2001 From: Vince Prignano Date: Mon, 8 Apr 2024 08:43:35 -0700 Subject: [PATCH 17/33] Add github action to package envtest binaries in releases Signed-off-by: Vince Prignano --- .github/workflows/tools-releases.yml | 69 ++++++++++------------------ .gitignore | 1 + Makefile | 43 +++++++++++++++++ envtest-releases.yaml | 1 + hack/envtest/_matrix/v1.28.0.yaml | 1 + hack/envtest/darwin/Dockerfile | 10 +++- hack/envtest/linux/Dockerfile | 10 +++- hack/envtest/update-releases.sh | 44 ++++++++++++++++++ hack/envtest/windows/Dockerfile | 10 +++- 9 files changed, 142 insertions(+), 47 deletions(-) create mode 100644 envtest-releases.yaml create mode 100755 hack/envtest/update-releases.sh diff --git a/.github/workflows/tools-releases.yml b/.github/workflows/tools-releases.yml index 7e195c387..9b411698f 100644 --- a/.github/workflows/tools-releases.yml +++ b/.github/workflows/tools-releases.yml @@ -8,27 +8,12 @@ on: - 'hack/envtest/_matrix/*.yaml' permissions: - contents: read - packages: write + contents: write + pull-requests: write jobs: build-and-push: runs-on: ubuntu-latest - strategy: - matrix: - os: - - linux - - darwin - arch: - - amd64 - - arm64 - include: - - arch: ppc64le - os: linux - - arch: s390x - os: linux - - arch: amd64 - os: windows steps: - name: Checkout code uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # tag=v4.1.2 @@ -42,38 +27,34 @@ jobs: id: release-version run: | if [[ ${{ steps.changed-files.outputs.all_changed_files_count }} != 1 ]]; then - echo "One Kubernetes patch version files should be changed to create a package, found ${{ steps.changed-files.outputs.all_changed_files_count }}" + echo "One Kubernetes patch version files should be changed for a release, found ${{ steps.changed-files.outputs.all_changed_files_count }}" exit 1 fi + for changed_file in ${{ steps.changed-files.outputs.all_changed_files }}; do export KUBERNETES_VERSION=$(echo "${changed_file}" | grep -oP '(?<=/)[^/]+(?=\.yaml)') echo "KUBERNETES_VERSION=$KUBERNETES_VERSION" >> $GITHUB_ENV - - GO_VERSION=$(yq eval '.go' $changed_file) - echo "GO_VERSION=$GO_VERSION" >> $GITHUB_ENV - - ETCD_VERSION=$(yq eval '.etcd' $changed_file) - echo "ETCD_VERSION=$ETCD_VERSION" >> $GITHUB_ENV done - - name: Set up Docker - uses: docker/setup-buildx-action@d70bba72b1f3fd22344832f00baa16ece964efeb # tag=v3.3.0 - - name: Log in to the Container registry - uses: docker/login-action@e92390c5fb421da1463c202d546fed0ec5c39f20 # tag=v3.1.0 + - name: Build packages + run: | + make release-envtest KUBERNETES_VERSION=${{ env.KUBERNETES_VERSION }} + - name: Release + uses: softprops/action-gh-release@9d7c94cfd0a1f3ed45544c887983e9fa900f0564 # tag=v2.0.4 with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - name: Build and push Docker images - uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 # tag=v5.3.0 + name: envtest-${{ env.KUBERNETES_VERSION }} + draft: true + make_latest: false + files: | + out/envtest-*.tar.gz + out/envtest-*.tar.gz.sha512 + fail_on_unmatched_files: true + - name: Create Pull Request + uses: peter-evans/create-pull-request@9153d834b60caba6d51c9b9510b087acf9f33f83 # tag=v6.0.4 with: - context: . - file: ./hack/envtest/${{matrix.os}}/Dockerfile - build-args: | - GO_VERSION=${{env.GO_VERSION}} - KUBERNETES_VERSION=${{env.KUBERNETES_VERSION}} - ETCD_VERSION=${{env.ETCD_VERSION}} - OS=${{matrix.os}} - ARCH=${{matrix.arch}} - push: true - tags: | - ghcr.io/kubernetes-sigs/controller-tools/envtest:${{env.KUBERNETES_VERSION}}-${{matrix.os}}-${{matrix.arch}} + commit-message: Promote envtest release for Kubernetes ${{ env.KUBERNETES_VERSION }} + title: ":seedling: Promotion of envtest release for Kubernetes ${{ env.KUBERNETES_VERSION }}" + body: | + This PR promotes the envtest release for Kubernetes ${{ env.KUBERNETES_VERSION }}. + branch: promote-envtest-${{ env.KUBERNETES_VERSION }} + add-paths: | + envtest-releases.yaml diff --git a/.gitignore b/.gitignore index 7a427bdbe..01a75264a 100644 --- a/.gitignore +++ b/.gitignore @@ -18,6 +18,7 @@ *~ # Tools binaries. +out hack/tools/bin junit-report.xml diff --git a/Makefile b/Makefile index 6bc225d3f..3f07ea451 100644 --- a/Makefile +++ b/Makefile @@ -35,6 +35,8 @@ export GOPROXY export GO111MODULE=on # Tools. +ENVTEST_DIR := hack/envtest +ENVTEST_MATRIX_DIR := $(ENVTEST_DIR)/_matrix TOOLS_DIR := hack/tools TOOLS_BIN_DIR := $(abspath $(TOOLS_DIR)/bin) GOLANGCI_LINT := $(abspath $(TOOLS_BIN_DIR)/golangci-lint) @@ -92,3 +94,44 @@ clean: ## Cleanup. .PHONY: clean-bin clean-bin: ## Remove all generated binaries. rm -rf hack/tools/bin + +.PHONE: clean-release +clean-release: ## Remove all generated release binaries. + rm -rf $(RELEASE_DIR) + +## -------------------------------------- +## Envtest Build +## -------------------------------------- + +RELEASE_DIR := out + +.PHONY: $(RELEASE_DIR) +$(RELEASE_DIR): + mkdir -p $(RELEASE_DIR)/ + +.PHONY: release-envtest +release-envtest: clean-release ## Build the envtest binaries by operating system. + OS=linux ARCH=amd64 $(MAKE) release-envtest-docker-build + OS=linux ARCH=arm64 $(MAKE) release-envtest-docker-build + OS=linux ARCH=ppc64le $(MAKE) release-envtest-docker-build + OS=linux ARCH=s390x $(MAKE) release-envtest-docker-build + OS=darwin ARCH=amd64 $(MAKE) release-envtest-docker-build + OS=darwin ARCH=arm64 $(MAKE) release-envtest-docker-build + OS=windows ARCH=amd64 $(MAKE) release-envtest-docker-build + ./hack/envtest/update-releases.sh + +.PHONY: release-envtest-docker-build +release-envtest-docker-build: $(RELEASE_DIR) ## Build the envtest binaries. + @: $(if $(KUBERNETES_VERSION),,$(error KUBERNETES_VERSION is not set)) + @: $(if $(OS),,$(error OS is not set)) + @: $(if $(ARCH),,$(error ARCH is not set)) + docker buildx build \ + --file ./hack/envtest/$(OS)/Dockerfile \ + --build-arg KUBERNETES_VERSION=$(KUBERNETES_VERSION) \ + --build-arg GO_VERSION=$(shell yq eval '.go' $(ENVTEST_MATRIX_DIR)/$(KUBERNETES_VERSION).yaml) \ + --build-arg ETCD_VERSION=$(shell yq eval '.etcd' $(ENVTEST_MATRIX_DIR)/$(KUBERNETES_VERSION).yaml) \ + --build-arg OS=$(OS) \ + --build-arg ARCH=$(ARCH) \ + --tag sigs.k8s.io/controller-tools/envtest:$(KUBERNETES_VERSION)-$(OS)-$(ARCH) \ + --output type=local,dest=$(RELEASE_DIR) \ + . diff --git a/envtest-releases.yaml b/envtest-releases.yaml new file mode 100644 index 000000000..3a59fc4e7 --- /dev/null +++ b/envtest-releases.yaml @@ -0,0 +1 @@ +releases: diff --git a/hack/envtest/_matrix/v1.28.0.yaml b/hack/envtest/_matrix/v1.28.0.yaml index 83bf3ddd8..6a369c454 100644 --- a/hack/envtest/_matrix/v1.28.0.yaml +++ b/hack/envtest/_matrix/v1.28.0.yaml @@ -1,2 +1,3 @@ go: 1.21 etcd: v3.5.9 + diff --git a/hack/envtest/darwin/Dockerfile b/hack/envtest/darwin/Dockerfile index 8adf45ace..c5746b5bf 100644 --- a/hack/envtest/darwin/Dockerfile +++ b/hack/envtest/darwin/Dockerfile @@ -51,6 +51,14 @@ RUN curl -sfLO https://github.com/coreos/etcd/releases/download/${ETCD_VERSION}/ unzip -o ${ETCD_BASE_NAME}.zip && \ cp ${ETCD_BASE_NAME}/etcd $DEST +# Package into tarball. +RUN tar -czvf /envtest-${KUBERNETES_VERSION}-${OS}-${ARCH}.tar.gz $DEST +RUN sha512sum /envtest-${KUBERNETES_VERSION}-${OS}-${ARCH}.tar.gz > /envtest-${KUBERNETES_VERSION}-${OS}-${ARCH}.tar.gz.sha512 + # Build the final image with the binaries. FROM scratch -COPY --from=builder /controller-tools/envtest /controller-tools/envtest +ARG OS +ARG ARCH +ARG KUBERNETES_VERSION +COPY --from=builder /envtest-${KUBERNETES_VERSION}-${OS}-${ARCH}.tar.gz / +COPY --from=builder /envtest-${KUBERNETES_VERSION}-${OS}-${ARCH}.tar.gz.sha512 / diff --git a/hack/envtest/linux/Dockerfile b/hack/envtest/linux/Dockerfile index d68072ec5..cbc743fd2 100644 --- a/hack/envtest/linux/Dockerfile +++ b/hack/envtest/linux/Dockerfile @@ -45,6 +45,14 @@ RUN curl -sfLO https://github.com/coreos/etcd/releases/download/${ETCD_VERSION}/ tar xzf ${ETCD_BASE_NAME}.tar.gz && \ cp ${ETCD_BASE_NAME}/etcd $DEST +# Package into tarball. +RUN tar -czvf /envtest-${KUBERNETES_VERSION}-${OS}-${ARCH}.tar.gz $DEST +RUN sha512sum /envtest-${KUBERNETES_VERSION}-${OS}-${ARCH}.tar.gz > /envtest-${KUBERNETES_VERSION}-${OS}-${ARCH}.tar.gz.sha512 + # Build the final image with the binaries. FROM scratch -COPY --from=builder /controller-tools/envtest /controller-tools/envtest +ARG OS +ARG ARCH +ARG KUBERNETES_VERSION +COPY --from=builder /envtest-${KUBERNETES_VERSION}-${OS}-${ARCH}.tar.gz / +COPY --from=builder /envtest-${KUBERNETES_VERSION}-${OS}-${ARCH}.tar.gz.sha512 / diff --git a/hack/envtest/update-releases.sh b/hack/envtest/update-releases.sh new file mode 100755 index 000000000..fbecbb55f --- /dev/null +++ b/hack/envtest/update-releases.sh @@ -0,0 +1,44 @@ +#!/usr/bin/env bash +# Copyright 2024 The Kubernetes Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -o errexit +set -o nounset +set -o pipefail +set -x + +ROOT=$(dirname "${BASH_SOURCE[0]}")/../.. + +if [ -z "${KUBERNETES_VERSION}" ]; then + echo "Missing KUBERNETES_VERSION environment variable" + exit 1 +fi + +# Create the releases.yaml file in hack/envtest if it does not exist +if [ ! -f "${ROOT}"/envtest-releases.yaml ]; then + echo "releases:" > "${ROOT}"/envtest-releases.yaml +fi + +# Add the newly built Kubernetes version to the releases.yaml file with yq as an object key under releases +yq eval ".releases += {\"${KUBERNETES_VERSION}\": {}}" -i "${ROOT}"/envtest-releases.yaml + +for file in "${ROOT}"/out/*.tar.gz; do + file_name=$(basename "${file}") + file_hash=$(awk '{ print $1 }' < "${file}.sha512") + self_link=https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-${KUBERNETES_VERSION}/${file_name} + + yq eval \ + ".releases[\"${KUBERNETES_VERSION}\"] += {\"${file_name}\": {\"hash\": \"${file_hash}\", \"self_link\": \"${self_link}\"}}" \ + -i "${ROOT}"/envtest-releases.yaml +done diff --git a/hack/envtest/windows/Dockerfile b/hack/envtest/windows/Dockerfile index a74a73c0d..81ee2188c 100644 --- a/hack/envtest/windows/Dockerfile +++ b/hack/envtest/windows/Dockerfile @@ -51,6 +51,14 @@ RUN curl -sfLO https://github.com/coreos/etcd/releases/download/${ETCD_VERSION}/ unzip -o ${ETCD_BASE_NAME}.zip && \ cp ${ETCD_BASE_NAME}/etcd.exe $DEST +# Package into tarball. +RUN tar -czvf /envtest-${KUBERNETES_VERSION}-${OS}-${ARCH}.tar.gz $DEST +RUN sha512sum /envtest-${KUBERNETES_VERSION}-${OS}-${ARCH}.tar.gz > /envtest-${KUBERNETES_VERSION}-${OS}-${ARCH}.tar.gz.sha512 + # Build the final image with the binaries. FROM scratch -COPY --from=builder /controller-tools/envtest /controller-tools/envtest +ARG OS +ARG ARCH +ARG KUBERNETES_VERSION +COPY --from=builder /envtest-${KUBERNETES_VERSION}-${OS}-${ARCH}.tar.gz / +COPY --from=builder /envtest-${KUBERNETES_VERSION}-${OS}-${ARCH}.tar.gz.sha512 / From 57b8a0ecf3b2866db4a1876eb7b10a02df57ab0c Mon Sep 17 00:00:00 2001 From: Stefan Bueringer Date: Wed, 17 Apr 2024 20:07:55 +0200 Subject: [PATCH 18/33] Release envtest v1.28.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Stefan Büringer buringerst@vmware.com --- hack/envtest/_matrix/v1.28.0.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/hack/envtest/_matrix/v1.28.0.yaml b/hack/envtest/_matrix/v1.28.0.yaml index 6a369c454..83bf3ddd8 100644 --- a/hack/envtest/_matrix/v1.28.0.yaml +++ b/hack/envtest/_matrix/v1.28.0.yaml @@ -1,3 +1,2 @@ go: 1.21 etcd: v3.5.9 - From d7866608cc7c33d7f3c45d9ebc70262780a76e78 Mon Sep 17 00:00:00 2001 From: Vince Prignano Date: Mon, 8 Apr 2024 08:43:35 -0700 Subject: [PATCH 19/33] Add github action to package envtest binaries in releases Signed-off-by: Vince Prignano --- .github/workflows/golangci-lint.yml | 2 +- .github/workflows/tools-releases.yml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index 7baade1aa..83193a5fc 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -4,6 +4,7 @@ on: types: [opened, edited, synchronize, reopened] branches: - main + - master permissions: # Required: allow read access to the content for analysis. @@ -21,7 +22,6 @@ jobs: matrix: working-directory: - "" - - tools/setup-envtest steps: - name: Set up Go uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # tag=v5.0.0 diff --git a/.github/workflows/tools-releases.yml b/.github/workflows/tools-releases.yml index 9b411698f..b4dda9f82 100644 --- a/.github/workflows/tools-releases.yml +++ b/.github/workflows/tools-releases.yml @@ -4,6 +4,7 @@ on: push: branches: - main + - master paths: - 'hack/envtest/_matrix/*.yaml' From 0e97d420fd27835c196ed2fb3daa75190f4c5037 Mon Sep 17 00:00:00 2001 From: k8s-ci-robot <20407524+k8s-ci-robot@users.noreply.github.com> Date: Wed, 17 Apr 2024 18:45:17 +0000 Subject: [PATCH 20/33] Promote envtest release for Kubernetes v1.28.0 --- envtest-releases.yaml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/envtest-releases.yaml b/envtest-releases.yaml index 3a59fc4e7..49dc69ebf 100644 --- a/envtest-releases.yaml +++ b/envtest-releases.yaml @@ -1 +1,23 @@ releases: + v1.28.0: + envtest-v1.28.0-darwin-amd64.tar.gz: + hash: f4c5ae38e1331c32b416c47536aa3d35e58b9b9b3800b5e0f46ec8495b4ec891dcc99366dd9aa44f8b7aeb24269f117fd8672027902706d885b1beb1abdc771c + self_link: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.28.0/envtest-v1.28.0-darwin-amd64.tar.gz + envtest-v1.28.0-darwin-arm64.tar.gz: + hash: 0df39d01e57f8175e86e843fc1d75df4028a2889feb7477d65220c120c04a2db511b1c4a4303d5b1ef34ad0c1733c1de17a64502898c9625b2a35bcca13d7979 + self_link: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.28.0/envtest-v1.28.0-darwin-arm64.tar.gz + envtest-v1.28.0-linux-amd64.tar.gz: + hash: 000c9adc2c140bed3f73e28caabdfa82d76d7c35c4b0cf93322d0fcbc1f28a070962e928c9132ea6b60c02ed677a7449cfab0b91134971419a21dab65ce5781e + self_link: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.28.0/envtest-v1.28.0-linux-amd64.tar.gz + envtest-v1.28.0-linux-arm64.tar.gz: + hash: 4a68bc6ec20c63db330f763bf347bbf791d335fa2861de6b9a89cf8132bbd538049495055e0c47779d8aa6877e2cdb7cda01064609f55be3a5dff144f48cf084 + self_link: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.28.0/envtest-v1.28.0-linux-arm64.tar.gz + envtest-v1.28.0-linux-ppc64le.tar.gz: + hash: 5fd02dfca7e74cf5c752c4d4f31005a8316c4690485804e38e10ed8a7bc1a2c638d9f4bcf1568cfe7e19ae14ccd2aa62684e6c564acc9024dc74df28070b19ae + self_link: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.28.0/envtest-v1.28.0-linux-ppc64le.tar.gz + envtest-v1.28.0-linux-s390x.tar.gz: + hash: 4fddb7f62b6b07bd4d395f3995e0d3a30788fa409064ad23d8371332b647a681e8c10042f98f02e95b344e5bf8c6e01106feebf968c20de42eddb30832a8c78d + self_link: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.28.0/envtest-v1.28.0-linux-s390x.tar.gz + envtest-v1.28.0-windows-amd64.tar.gz: + hash: cf80fda14a3d7c8ab4e1565a6243e53546c0e52b7344c342296495fc537b5094f4d15e927198a439127f8352bf6b43f6a8a00b217c5756bc405705ecc154f581 + self_link: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.28.0/envtest-v1.28.0-windows-amd64.tar.gz From 61fc956cbd708f7d00b432b032302a745b6fb528 Mon Sep 17 00:00:00 2001 From: Vince Prignano Date: Wed, 17 Apr 2024 11:54:22 -0700 Subject: [PATCH 21/33] :seedling: Automatically release, fixup selfLink in camelcase Signed-off-by: Vince Prignano --- .github/workflows/tools-releases.yml | 2 +- envtest-releases.yaml | 14 +++++++------- hack/envtest/update-releases.sh | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/tools-releases.yml b/.github/workflows/tools-releases.yml index b4dda9f82..0f2cb8c0d 100644 --- a/.github/workflows/tools-releases.yml +++ b/.github/workflows/tools-releases.yml @@ -43,7 +43,7 @@ jobs: uses: softprops/action-gh-release@9d7c94cfd0a1f3ed45544c887983e9fa900f0564 # tag=v2.0.4 with: name: envtest-${{ env.KUBERNETES_VERSION }} - draft: true + draft: false make_latest: false files: | out/envtest-*.tar.gz diff --git a/envtest-releases.yaml b/envtest-releases.yaml index 49dc69ebf..914a2234f 100644 --- a/envtest-releases.yaml +++ b/envtest-releases.yaml @@ -2,22 +2,22 @@ releases: v1.28.0: envtest-v1.28.0-darwin-amd64.tar.gz: hash: f4c5ae38e1331c32b416c47536aa3d35e58b9b9b3800b5e0f46ec8495b4ec891dcc99366dd9aa44f8b7aeb24269f117fd8672027902706d885b1beb1abdc771c - self_link: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.28.0/envtest-v1.28.0-darwin-amd64.tar.gz + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.28.0/envtest-v1.28.0-darwin-amd64.tar.gz envtest-v1.28.0-darwin-arm64.tar.gz: hash: 0df39d01e57f8175e86e843fc1d75df4028a2889feb7477d65220c120c04a2db511b1c4a4303d5b1ef34ad0c1733c1de17a64502898c9625b2a35bcca13d7979 - self_link: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.28.0/envtest-v1.28.0-darwin-arm64.tar.gz + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.28.0/envtest-v1.28.0-darwin-arm64.tar.gz envtest-v1.28.0-linux-amd64.tar.gz: hash: 000c9adc2c140bed3f73e28caabdfa82d76d7c35c4b0cf93322d0fcbc1f28a070962e928c9132ea6b60c02ed677a7449cfab0b91134971419a21dab65ce5781e - self_link: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.28.0/envtest-v1.28.0-linux-amd64.tar.gz + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.28.0/envtest-v1.28.0-linux-amd64.tar.gz envtest-v1.28.0-linux-arm64.tar.gz: hash: 4a68bc6ec20c63db330f763bf347bbf791d335fa2861de6b9a89cf8132bbd538049495055e0c47779d8aa6877e2cdb7cda01064609f55be3a5dff144f48cf084 - self_link: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.28.0/envtest-v1.28.0-linux-arm64.tar.gz + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.28.0/envtest-v1.28.0-linux-arm64.tar.gz envtest-v1.28.0-linux-ppc64le.tar.gz: hash: 5fd02dfca7e74cf5c752c4d4f31005a8316c4690485804e38e10ed8a7bc1a2c638d9f4bcf1568cfe7e19ae14ccd2aa62684e6c564acc9024dc74df28070b19ae - self_link: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.28.0/envtest-v1.28.0-linux-ppc64le.tar.gz + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.28.0/envtest-v1.28.0-linux-ppc64le.tar.gz envtest-v1.28.0-linux-s390x.tar.gz: hash: 4fddb7f62b6b07bd4d395f3995e0d3a30788fa409064ad23d8371332b647a681e8c10042f98f02e95b344e5bf8c6e01106feebf968c20de42eddb30832a8c78d - self_link: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.28.0/envtest-v1.28.0-linux-s390x.tar.gz + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.28.0/envtest-v1.28.0-linux-s390x.tar.gz envtest-v1.28.0-windows-amd64.tar.gz: hash: cf80fda14a3d7c8ab4e1565a6243e53546c0e52b7344c342296495fc537b5094f4d15e927198a439127f8352bf6b43f6a8a00b217c5756bc405705ecc154f581 - self_link: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.28.0/envtest-v1.28.0-windows-amd64.tar.gz + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.28.0/envtest-v1.28.0-windows-amd64.tar.gz diff --git a/hack/envtest/update-releases.sh b/hack/envtest/update-releases.sh index fbecbb55f..21ca91f85 100755 --- a/hack/envtest/update-releases.sh +++ b/hack/envtest/update-releases.sh @@ -39,6 +39,6 @@ for file in "${ROOT}"/out/*.tar.gz; do self_link=https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-${KUBERNETES_VERSION}/${file_name} yq eval \ - ".releases[\"${KUBERNETES_VERSION}\"] += {\"${file_name}\": {\"hash\": \"${file_hash}\", \"self_link\": \"${self_link}\"}}" \ + ".releases[\"${KUBERNETES_VERSION}\"] += {\"${file_name}\": {\"hash\": \"${file_hash}\", \"selfLink\": \"${self_link}\"}}" \ -i "${ROOT}"/envtest-releases.yaml done From 19f08b71b1bb240112405714f093aa631830c5ee Mon Sep 17 00:00:00 2001 From: Vince Prignano Date: Wed, 17 Apr 2024 11:56:48 -0700 Subject: [PATCH 22/33] :seedling: Release envtest-v1.29.4 Signed-off-by: Vince Prignano --- hack/envtest/_matrix/{v1.29.3.yaml => v1.29.4.yaml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename hack/envtest/_matrix/{v1.29.3.yaml => v1.29.4.yaml} (100%) diff --git a/hack/envtest/_matrix/v1.29.3.yaml b/hack/envtest/_matrix/v1.29.4.yaml similarity index 100% rename from hack/envtest/_matrix/v1.29.3.yaml rename to hack/envtest/_matrix/v1.29.4.yaml From 9696b0c682c277a3cb06340d8a06987a9f407f74 Mon Sep 17 00:00:00 2001 From: Vince Prignano Date: Wed, 17 Apr 2024 12:55:11 -0700 Subject: [PATCH 23/33] Release action should create a tag Signed-off-by: Vince Prignano --- .github/workflows/tools-releases.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tools-releases.yml b/.github/workflows/tools-releases.yml index 0f2cb8c0d..e93b0a6f9 100644 --- a/.github/workflows/tools-releases.yml +++ b/.github/workflows/tools-releases.yml @@ -42,7 +42,7 @@ jobs: - name: Release uses: softprops/action-gh-release@9d7c94cfd0a1f3ed45544c887983e9fa900f0564 # tag=v2.0.4 with: - name: envtest-${{ env.KUBERNETES_VERSION }} + tag_name: envtest-${{ env.KUBERNETES_VERSION }} draft: false make_latest: false files: | From 862ec35a2395849146c424fec4d49db706e68d42 Mon Sep 17 00:00:00 2001 From: Vince Prignano Date: Wed, 17 Apr 2024 12:57:41 -0700 Subject: [PATCH 24/33] Release trigger for envtest-v1.29.4 Signed-off-by: Vince Prignano --- hack/envtest/_matrix/v1.29.4.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/hack/envtest/_matrix/v1.29.4.yaml b/hack/envtest/_matrix/v1.29.4.yaml index d35406399..1090968d7 100644 --- a/hack/envtest/_matrix/v1.29.4.yaml +++ b/hack/envtest/_matrix/v1.29.4.yaml @@ -1,2 +1,3 @@ go: 1.21 etcd: v3.5.12 + From 2253f6626c0d00f337998271ba06f9fb9f2b9bc6 Mon Sep 17 00:00:00 2001 From: vincepri <3118335+vincepri@users.noreply.github.com> Date: Wed, 17 Apr 2024 20:10:01 +0000 Subject: [PATCH 25/33] Promote envtest release for Kubernetes v1.29.4 --- envtest-releases.yaml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/envtest-releases.yaml b/envtest-releases.yaml index 914a2234f..3fdbb6ebf 100644 --- a/envtest-releases.yaml +++ b/envtest-releases.yaml @@ -21,3 +21,25 @@ releases: envtest-v1.28.0-windows-amd64.tar.gz: hash: cf80fda14a3d7c8ab4e1565a6243e53546c0e52b7344c342296495fc537b5094f4d15e927198a439127f8352bf6b43f6a8a00b217c5756bc405705ecc154f581 selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.28.0/envtest-v1.28.0-windows-amd64.tar.gz + v1.29.4: + envtest-v1.29.4-darwin-amd64.tar.gz: + hash: 9631990f3cd5d5020f807e13639baabccd82051604473b7a5bfc143dc9207e4c32f6f64be46893f07d0723cd519c38499563dc0ef442c7897533470f559d8036 + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.29.4/envtest-v1.29.4-darwin-amd64.tar.gz + envtest-v1.29.4-darwin-arm64.tar.gz: + hash: d46c24070f983089a02cb1c5f1bfa42c4ccc5b8509e72f7bac50d7a4b45fea2f7111db569d658137362667ff26a88b49bc6fad1dbc1083342e6d642876ca6abb + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.29.4/envtest-v1.29.4-darwin-arm64.tar.gz + envtest-v1.29.4-linux-amd64.tar.gz: + hash: ac6f0fd04d09e06a31786dbf82891f6db459e787f12cccb668704aad18329af7c1a7bc3bc5c4b07c4fa59fb8310fac1e1db117e7c073de59d8f44f97e2fbcbfa + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.29.4/envtest-v1.29.4-linux-amd64.tar.gz + envtest-v1.29.4-linux-arm64.tar.gz: + hash: c1152157187241a207dafc5e8a5dbad92316b0533319a2425c1db5ff2a8a2988301440d955265d621ade249c4cba0349a8944c8ec3e89a4f12813575ebc249f4 + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.29.4/envtest-v1.29.4-linux-arm64.tar.gz + envtest-v1.29.4-linux-ppc64le.tar.gz: + hash: 6cf2f80abc27a8e6536a05cb1e051d18ee1a4662d8e02dcad73b8798162aab3cda04fe08aaa84fe312004e03de389a79148b20ba080d2083cafb4b708b92339b + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.29.4/envtest-v1.29.4-linux-ppc64le.tar.gz + envtest-v1.29.4-linux-s390x.tar.gz: + hash: 6666f9f906460b0b386b3227f80a59cf92f6377c12e702304817faefb21d04eaef6204738bea13de2ac6b4462c1717b7de927755de270fc2297304cfef7fa8e6 + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.29.4/envtest-v1.29.4-linux-s390x.tar.gz + envtest-v1.29.4-windows-amd64.tar.gz: + hash: a56729c968fe462a002b4afe041f8700900853c114d4a643e9ddb2e2cedf786ebd5a02203418728a1304145b5a089f6693120456af4e78b7d0a5d70a9b4c58a3 + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.29.4/envtest-v1.29.4-windows-amd64.tar.gz From c41b0f6ec41f9252c3de9d324a7b15e554c67121 Mon Sep 17 00:00:00 2001 From: Stefan Bueringer Date: Thu, 18 Apr 2024 11:12:29 +0200 Subject: [PATCH 26/33] Release envtest v1.30.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Stefan Büringer buringerst@vmware.com --- hack/envtest/_matrix/v1.30.0.yaml | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 hack/envtest/_matrix/v1.30.0.yaml diff --git a/hack/envtest/_matrix/v1.30.0.yaml b/hack/envtest/_matrix/v1.30.0.yaml new file mode 100644 index 000000000..ae8ee24db --- /dev/null +++ b/hack/envtest/_matrix/v1.30.0.yaml @@ -0,0 +1,2 @@ +go: 1.22 +etcd: v3.5.12 From 44c7c66e211e4d0ecd0ee8ea5dc0741d848f2daa Mon Sep 17 00:00:00 2001 From: k8s-ci-robot <20407524+k8s-ci-robot@users.noreply.github.com> Date: Thu, 18 Apr 2024 09:29:07 +0000 Subject: [PATCH 27/33] Promote envtest release for Kubernetes v1.30.0 --- envtest-releases.yaml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/envtest-releases.yaml b/envtest-releases.yaml index 3fdbb6ebf..22280d64a 100644 --- a/envtest-releases.yaml +++ b/envtest-releases.yaml @@ -43,3 +43,25 @@ releases: envtest-v1.29.4-windows-amd64.tar.gz: hash: a56729c968fe462a002b4afe041f8700900853c114d4a643e9ddb2e2cedf786ebd5a02203418728a1304145b5a089f6693120456af4e78b7d0a5d70a9b4c58a3 selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.29.4/envtest-v1.29.4-windows-amd64.tar.gz + v1.30.0: + envtest-v1.30.0-darwin-amd64.tar.gz: + hash: e705b35189052880afefeac72797834d2750bfcfc8971dd913cc2b5575ea7222e9cfa3ebb38a5e5deec8f06089ecc654beaf9c4fe990acf41e57758c26b3d62a + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.30.0/envtest-v1.30.0-darwin-amd64.tar.gz + envtest-v1.30.0-darwin-arm64.tar.gz: + hash: 48c1fa5555f021f8aa365faaa96b106804ce5e3022142a2a166bc91ecd5b22da79f012d20c1a4963e0236df00a214f3311cdd842de4ab19442ca1c83b3bcb859 + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.30.0/envtest-v1.30.0-darwin-arm64.tar.gz + envtest-v1.30.0-linux-amd64.tar.gz: + hash: d53870e1a6c9b3b50366489a9387f4e254c664955e932e3e25e2088bb437b270bfab75d241b50849233f9a34bb1f08b41567ebb81ea29352104ae0f5b1cb9e88 + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.30.0/envtest-v1.30.0-linux-amd64.tar.gz + envtest-v1.30.0-linux-arm64.tar.gz: + hash: 140748efaa394598f50175e809cd53896881ed046d93ebdfbd5442100f68b3d8d51fd22f8cf1ae06a6e43473897b789df0db6e0ae6c45c8320b000d5ee900005 + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.30.0/envtest-v1.30.0-linux-arm64.tar.gz + envtest-v1.30.0-linux-ppc64le.tar.gz: + hash: 04e3570354001547d04eff1764d0dada9f5451fead5544e7f30457874b4d157fc62b769026f4c4fe3b8defa52892b722532229e2c6c27ad98c358c76ad018426 + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.30.0/envtest-v1.30.0-linux-ppc64le.tar.gz + envtest-v1.30.0-linux-s390x.tar.gz: + hash: 19f2d516b5b7753afdab991901e690cdb728367b783b32339cbe2d138619b35c1e59d13368b783a6b455b30d190abdfeb7997c48ae1710f66c69b2dc37c84375 + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.30.0/envtest-v1.30.0-linux-s390x.tar.gz + envtest-v1.30.0-windows-amd64.tar.gz: + hash: bf0846337d2fb85b9676ae5eb47c676e9315612dccba2e4fc748d6c76bc1228321cfa182274e9773d649c2298f624f62278032c547736159a8695b1712de64d0 + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.30.0/envtest-v1.30.0-windows-amd64.tar.gz From c3ec9f90ec141376fa92324183a2f9347736519b Mon Sep 17 00:00:00 2001 From: Stefan Bueringer Date: Thu, 18 Apr 2024 11:39:06 +0200 Subject: [PATCH 28/33] Bump to k8s.io/* v1.30 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Stefan Büringer buringerst@vmware.com --- go.mod | 6 +++--- go.sum | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index 259476dfe..a59479598 100644 --- a/go.mod +++ b/go.mod @@ -13,9 +13,9 @@ require ( golang.org/x/tools v0.20.0 gopkg.in/yaml.v2 v2.4.0 gopkg.in/yaml.v3 v3.0.1 - k8s.io/api v0.30.0-rc.1 - k8s.io/apiextensions-apiserver v0.30.0-rc.1 - k8s.io/apimachinery v0.30.0-rc.1 + k8s.io/api v0.30.0 + k8s.io/apiextensions-apiserver v0.30.0 + k8s.io/apimachinery v0.30.0 sigs.k8s.io/yaml v1.4.0 ) diff --git a/go.sum b/go.sum index ebae33186..97664c568 100644 --- a/go.sum +++ b/go.sum @@ -164,12 +164,12 @@ gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -k8s.io/api v0.30.0-rc.1 h1:0163kmXvT0JoER+nh9h1nSgX+sDwYYHPBgs+rWqjVIg= -k8s.io/api v0.30.0-rc.1/go.mod h1:mfiQxBiaioCBgc+jzmDpSXmSEQkqeHTh4FVOAh1iEqU= -k8s.io/apiextensions-apiserver v0.30.0-rc.1 h1:RNfnKYPwdIZ+nBTUTeprdBzL2WVH0xn5BsLVeaUuHDA= -k8s.io/apiextensions-apiserver v0.30.0-rc.1/go.mod h1:8bhW7JKTNgvFkBrTbqyBQq3Sme1CwWjyEkt4pxf01Nc= -k8s.io/apimachinery v0.30.0-rc.1 h1:Zi5mcxPCvhwJL8S8tNC5AakszlABd3UWr6OOXqPDToM= -k8s.io/apimachinery v0.30.0-rc.1/go.mod h1:wEJvNDlfxMRaMhyv38SIHIEC9hah/xuzqUUhxIyUv7Y= +k8s.io/api v0.30.0 h1:siWhRq7cNjy2iHssOB9SCGNCl2spiF1dO3dABqZ8niA= +k8s.io/api v0.30.0/go.mod h1:OPlaYhoHs8EQ1ql0R/TsUgaRPhpKNxIMrKQfWUp8QSE= +k8s.io/apiextensions-apiserver v0.30.0 h1:jcZFKMqnICJfRxTgnC4E+Hpcq8UEhT8B2lhBcQ+6uAs= +k8s.io/apiextensions-apiserver v0.30.0/go.mod h1:N9ogQFGcrbWqAY9p2mUAL5mGxsLqwgtUce127VtRX5Y= +k8s.io/apimachinery v0.30.0 h1:qxVPsyDM5XS96NIh9Oj6LavoVFYff/Pon9cZeDIkHHA= +k8s.io/apimachinery v0.30.0/go.mod h1:iexa2somDaxdnj7bha06bhb43Zpa6eWH8N8dbqVjTUc= k8s.io/klog/v2 v2.120.1 h1:QXU6cPEOIslTGvZaXvFWiP9VKyeet3sawzTOvdXb4Vw= k8s.io/klog/v2 v2.120.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= k8s.io/utils v0.0.0-20230726121419-3b25d923346b h1:sgn3ZU783SCgtaSJjpcVVlRqd6GSnlTLKgpAAttJvpI= From e159968de7cb1b1b255b751770fd07bb25af5a80 Mon Sep 17 00:00:00 2001 From: Alexander Yastrebov Date: Fri, 19 Apr 2024 11:55:05 +0200 Subject: [PATCH 29/33] :sparkles: crd: allow specifying spec.preserveUnknownFields (#912) * crd: allow specifying spec.preserveUnknownFields Reinstate crd:preserveUnknownFields option removed by #607 to allow specifying the value of deprecated spec.preserveUnknownFields CRD field. This is useful for updating CRDs that were automatically converted from v1beta1 version which had true as a default value and resulted in: ``` $ kubectl get crd foo.bar -o yaml | grep preserveUnknownFields preserveUnknownFields: true message: 'spec.preserveUnknownFields: Invalid value: true: must be false' ``` For #476 * crd: rename marker to DeprecatedV1beta1CompatibilityPreserveUnknownFields --- pkg/crd/gen.go | 34 +++++++++++++++++++++++++++++- pkg/crd/gen_integration_test.go | 37 +++++++++++++++++++++++++++++++++ 2 files changed, 70 insertions(+), 1 deletion(-) diff --git a/pkg/crd/gen.go b/pkg/crd/gen.go index 9eb4126bc..ac8eb566d 100644 --- a/pkg/crd/gen.go +++ b/pkg/crd/gen.go @@ -85,6 +85,20 @@ type Generator struct { // Year specifies the year to substitute for " YEAR" in the header file. Year string `marker:",optional"` + + // DeprecatedV1beta1CompatibilityPreserveUnknownFields indicates whether + // or not we should turn off field pruning for this resource. + // + // Specifies spec.preserveUnknownFields value that is false and omitted by default. + // This value can only be specified for CustomResourceDefinitions that were created with + // `apiextensions.k8s.io/v1beta1`. + // + // The field can be set for compatiblity reasons, although strongly discouraged, resource + // authors should move to a structural OpenAPI schema instead. + // + // See https://kubernetes.io/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definitions/#field-pruning + // for more information about field pruning and v1beta1 resources compatibility. + DeprecatedV1beta1CompatibilityPreserveUnknownFields *bool `marker:",optional"` } func (Generator) CheckFilter() loader.NodeFilter { @@ -100,6 +114,16 @@ func transformRemoveCRDStatus(obj map[string]interface{}) error { return nil } +// transformPreserveUnknownFields adds spec.preserveUnknownFields=value. +func transformPreserveUnknownFields(value bool) func(map[string]interface{}) error { + return func(obj map[string]interface{}) error { + if spec, ok := obj["spec"].(map[interface{}]interface{}); ok { + spec["preserveUnknownFields"] = value + } + return nil + } +} + func (g Generator) Generate(ctx *genall.GenerationContext) error { parser := &Parser{ Collector: ctx.Collector, @@ -146,6 +170,14 @@ func (g Generator) Generate(ctx *genall.GenerationContext) error { } headerText = strings.ReplaceAll(headerText, " YEAR", " "+g.Year) + yamlOpts := []*genall.WriteYAMLOptions{ + genall.WithTransform(transformRemoveCRDStatus), + genall.WithTransform(genall.TransformRemoveCreationTimestamp), + } + if g.DeprecatedV1beta1CompatibilityPreserveUnknownFields != nil { + yamlOpts = append(yamlOpts, genall.WithTransform(transformPreserveUnknownFields(*g.DeprecatedV1beta1CompatibilityPreserveUnknownFields))) + } + for _, groupKind := range kubeKinds { parser.NeedCRDFor(groupKind, g.MaxDescLen) crdRaw := parser.CustomResourceDefinitions[groupKind] @@ -171,7 +203,7 @@ func (g Generator) Generate(ctx *genall.GenerationContext) error { } else { fileName = fmt.Sprintf("%s_%s.%s.yaml", crdRaw.Spec.Group, crdRaw.Spec.Names.Plural, crdVersions[i]) } - if err := ctx.WriteYAML(fileName, headerText, []interface{}{crd}, genall.WithTransform(transformRemoveCRDStatus), genall.WithTransform(genall.TransformRemoveCreationTimestamp)); err != nil { + if err := ctx.WriteYAML(fileName, headerText, []interface{}{crd}, yamlOpts...); err != nil { return err } } diff --git a/pkg/crd/gen_integration_test.go b/pkg/crd/gen_integration_test.go index e5dc41640..d59e3e923 100644 --- a/pkg/crd/gen_integration_test.go +++ b/pkg/crd/gen_integration_test.go @@ -119,6 +119,43 @@ var _ = Describe("CRD Generation proper defaulting", func() { expectedOut := string(expectedFileFoos) + string(expectedFileZoos) Expect(out.buf.String()).To(Equal(expectedOut), cmp.Diff(out.buf.String(), expectedOut)) }) + + It("should add preserveUnknownFields=false when specified", func() { + By("calling Generate") + no := false + gen := &crd.Generator{ + CRDVersions: []string{"v1"}, + DeprecatedV1beta1CompatibilityPreserveUnknownFields: &no, + } + Expect(gen.Generate(ctx)).NotTo(HaveOccurred()) + + By("searching preserveUnknownFields") + Expect(out.buf.String()).To(ContainSubstring("preserveUnknownFields: false")) + }) + + It("should add preserveUnknownFields=true when specified", func() { + By("calling Generate") + yes := true + gen := &crd.Generator{ + CRDVersions: []string{"v1"}, + DeprecatedV1beta1CompatibilityPreserveUnknownFields: &yes, + } + Expect(gen.Generate(ctx)).NotTo(HaveOccurred()) + + By("searching preserveUnknownFields") + Expect(out.buf.String()).To(ContainSubstring("preserveUnknownFields: true")) + }) + + It("should not add preserveUnknownFields when not specified", func() { + By("calling Generate") + gen := &crd.Generator{ + CRDVersions: []string{"v1"}, + } + Expect(gen.Generate(ctx)).NotTo(HaveOccurred()) + + By("searching preserveUnknownFields") + Expect(out.buf.String()).NotTo(ContainSubstring("preserveUnknownFields")) + }) }) // fixAnnotations fixes the attribution annotation for tests. From 04e6d44527c40f7f91e1293dcc275ad58bc7f19c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patryk=20Ma=C5=82ek?= Date: Sun, 21 Apr 2024 13:17:36 +0200 Subject: [PATCH 30/33] feat(crdvalidation): add messageExpression support to XValidation marker --- pkg/crd/markers/validation.go | 10 +- pkg/crd/markers/zz_generated.markerhelp.go | 106 +++++++++--------- pkg/crd/testdata/cronjob_types.go | 5 +- .../testdata.kubebuilder.io_cronjobs.yaml | 7 ++ pkg/crd/zz_generated.markerhelp.go | 18 +-- pkg/deepcopy/zz_generated.markerhelp.go | 4 +- pkg/genall/zz_generated.markerhelp.go | 12 +- pkg/rbac/zz_generated.markerhelp.go | 8 +- pkg/schemapatcher/zz_generated.markerhelp.go | 8 +- pkg/webhook/zz_generated.markerhelp.go | 48 ++++---- 10 files changed, 125 insertions(+), 101 deletions(-) diff --git a/pkg/crd/markers/validation.go b/pkg/crd/markers/validation.go index e8e67f74e..245c5ef92 100644 --- a/pkg/crd/markers/validation.go +++ b/pkg/crd/markers/validation.go @@ -309,8 +309,9 @@ func isIntegral(value float64) bool { // This marker may be repeated to specify multiple expressions, all of // which must evaluate to true. type XValidation struct { - Rule string - Message string `marker:",optional"` + Rule string + Message string `marker:",optional"` + MessageExpression string `marker:"messageExpression,optional"` } func (m Maximum) ApplyToSchema(schema *apiext.JSONSchemaProps) error { @@ -534,8 +535,9 @@ func (m XIntOrString) ApplyPriority() ApplyPriority { func (m XValidation) ApplyToSchema(schema *apiext.JSONSchemaProps) error { schema.XValidations = append(schema.XValidations, apiext.ValidationRule{ - Rule: m.Rule, - Message: m.Message, + Rule: m.Rule, + Message: m.Message, + MessageExpression: m.MessageExpression, }) return nil } diff --git a/pkg/crd/markers/zz_generated.markerhelp.go b/pkg/crd/markers/zz_generated.markerhelp.go index d8a910824..c10ffb2fc 100644 --- a/pkg/crd/markers/zz_generated.markerhelp.go +++ b/pkg/crd/markers/zz_generated.markerhelp.go @@ -28,8 +28,8 @@ func (Default) Help() *markers.DefinitionHelp { return &markers.DefinitionHelp{ Category: "CRD validation", DetailedHelp: markers.DetailedHelp{ - Summary: "sets the default value for this field. ", - Details: "A default value will be accepted as any value valid for the field. Formatting for common types include: boolean: `true`, string: `Cluster`, numerical: `1.24`, array: `{1,2}`, object: `{policy: \"delete\"}`). Defaults should be defined in pruned form, and only best-effort validation will be performed. Full validation of a default requires submission of the containing CRD to an apiserver.", + Summary: "sets the default value for this field.", + Details: "A default value will be accepted as any value valid for the\nfield. Formatting for common types include: boolean: `true`, string:\n`Cluster`, numerical: `1.24`, array: `{1,2}`, object: `{policy:\n\"delete\"}`). Defaults should be defined in pruned form, and only best-effort\nvalidation will be performed. Full validation of a default requires\nsubmission of the containing CRD to an apiserver.", }, FieldHelp: map[string]markers.DetailedHelp{ "Value": { @@ -71,8 +71,8 @@ func (Example) Help() *markers.DefinitionHelp { return &markers.DefinitionHelp{ Category: "CRD validation", DetailedHelp: markers.DetailedHelp{ - Summary: "sets the example value for this field. ", - Details: "An example value will be accepted as any value valid for the field. Formatting for common types include: boolean: `true`, string: `Cluster`, numerical: `1.24`, array: `{1,2}`, object: `{policy: \"delete\"}`). Examples should be defined in pruned form, and only best-effort validation will be performed. Full validation of an example requires submission of the containing CRD to an apiserver.", + Summary: "sets the example value for this field.", + Details: "An example value will be accepted as any value valid for the\nfield. Formatting for common types include: boolean: `true`, string:\n`Cluster`, numerical: `1.24`, array: `{1,2}`, object: `{policy:\n\"delete\"}`). Examples should be defined in pruned form, and only best-effort\nvalidation will be performed. Full validation of an example requires\nsubmission of the containing CRD to an apiserver.", }, FieldHelp: map[string]markers.DetailedHelp{ "Value": { @@ -109,8 +109,8 @@ func (Format) Help() *markers.DefinitionHelp { return &markers.DefinitionHelp{ Category: "CRD validation", DetailedHelp: markers.DetailedHelp{ - Summary: "specifies additional \"complex\" formatting for this field. ", - Details: "For example, a date-time field would be marked as \"type: string\" and \"format: date-time\".", + Summary: "specifies additional \"complex\" formatting for this field.", + Details: "For example, a date-time field would be marked as \"type: string\" and\n\"format: date-time\".", }, FieldHelp: map[string]markers.DetailedHelp{}, } @@ -120,8 +120,8 @@ func (ListMapKey) Help() *markers.DefinitionHelp { return &markers.DefinitionHelp{ Category: "CRD processing", DetailedHelp: markers.DetailedHelp{ - Summary: "specifies the keys to map listTypes. ", - Details: "It indicates the index of a map list. They can be repeated if multiple keys must be used. It can only be used when ListType is set to map, and the keys should be scalar types.", + Summary: "specifies the keys to map listTypes.", + Details: "It indicates the index of a map list. They can be repeated if multiple keys\nmust be used. It can only be used when ListType is set to map, and the keys\nshould be scalar types.", }, FieldHelp: map[string]markers.DetailedHelp{}, } @@ -131,8 +131,8 @@ func (ListType) Help() *markers.DefinitionHelp { return &markers.DefinitionHelp{ Category: "CRD processing", DetailedHelp: markers.DetailedHelp{ - Summary: "specifies the type of data-structure that the list represents (map, set, atomic). ", - Details: "Possible data-structure types of a list are: \n - \"map\": it needs to have a key field, which will be used to build an associative list. A typical example is a the pod container list, which is indexed by the container name. \n - \"set\": Fields need to be \"scalar\", and there can be only one occurrence of each. \n - \"atomic\": All the fields in the list are treated as a single value, are typically manipulated together by the same actor.", + Summary: "specifies the type of data-structure that the list", + Details: "represents (map, set, atomic).\n\n\nPossible data-structure types of a list are:\n\n\n - \"map\": it needs to have a key field, which will be used to build an\n associative list. A typical example is a the pod container list,\n which is indexed by the container name.\n\n\n - \"set\": Fields need to be \"scalar\", and there can be only one\n occurrence of each.\n\n\n - \"atomic\": All the fields in the list are treated as a single value,\n are typically manipulated together by the same actor.", }, FieldHelp: map[string]markers.DetailedHelp{}, } @@ -142,8 +142,8 @@ func (MapType) Help() *markers.DefinitionHelp { return &markers.DefinitionHelp{ Category: "CRD processing", DetailedHelp: markers.DetailedHelp{ - Summary: "specifies the level of atomicity of the map; i.e. whether each item in the map is independent of the others, or all fields are treated as a single unit. ", - Details: "Possible values: \n - \"granular\": items in the map are independent of each other, and can be manipulated by different actors. This is the default behavior. \n - \"atomic\": all fields are treated as one unit. Any changes have to replace the entire map.", + Summary: "specifies the level of atomicity of the map;", + Details: "i.e. whether each item in the map is independent of the others,\nor all fields are treated as a single unit.\n\n\nPossible values:\n\n\n - \"granular\": items in the map are independent of each other,\n and can be manipulated by different actors.\n This is the default behavior.\n\n\n - \"atomic\": all fields are treated as one unit.\n Any changes have to replace the entire map.", }, FieldHelp: map[string]markers.DetailedHelp{}, } @@ -197,8 +197,8 @@ func (Metadata) Help() *markers.DefinitionHelp { return &markers.DefinitionHelp{ Category: "CRD", DetailedHelp: markers.DetailedHelp{ - Summary: "configures the additional annotations or labels for this CRD. For example adding annotation \"api-approved.kubernetes.io\" for a CRD with Kubernetes groups, or annotation \"cert-manager.io/inject-ca-from-secret\" for a CRD that needs CA injection.", - Details: "", + Summary: "configures the additional annotations or labels for this CRD.", + Details: "For example adding annotation \"api-approved.kubernetes.io\" for a CRD with Kubernetes groups,\nor annotation \"cert-manager.io/inject-ca-from-secret\" for a CRD that needs CA injection.", }, FieldHelp: map[string]markers.DetailedHelp{ "Annotations": { @@ -272,7 +272,7 @@ func (Nullable) Help() *markers.DefinitionHelp { return &markers.DefinitionHelp{ Category: "CRD validation", DetailedHelp: markers.DetailedHelp{ - Summary: "marks this field as allowing the \"null\" value. ", + Summary: "marks this field as allowing the \"null\" value.", Details: "This is often not necessary, but may be helpful with custom serialization.", }, FieldHelp: map[string]markers.DetailedHelp{}, @@ -303,8 +303,8 @@ func (PrintColumn) Help() *markers.DefinitionHelp { Details: "", }, "Type": { - Summary: "indicates the type of the column. ", - Details: "It may be any OpenAPI data type listed at https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#data-types.", + Summary: "indicates the type of the column.", + Details: "It may be any OpenAPI data type listed at\nhttps://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#data-types.", }, "JSONPath": { Summary: "specifies the jsonpath expression used to extract the value of the column.", @@ -315,12 +315,12 @@ func (PrintColumn) Help() *markers.DefinitionHelp { Details: "", }, "Format": { - Summary: "specifies the format of the column. ", - Details: "It may be any OpenAPI data format corresponding to the type, listed at https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#data-types.", + Summary: "specifies the format of the column.", + Details: "It may be any OpenAPI data format corresponding to the type, listed at\nhttps://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#data-types.", }, "Priority": { - Summary: "indicates how important it is that this column be displayed. ", - Details: "Lower priority (*higher* numbered) columns will be hidden if the terminal width is too small.", + Summary: "indicates how important it is that this column be displayed.", + Details: "Lower priority (*higher* numbered) columns will be hidden if the terminal\nwidth is too small.", }, }, } @@ -335,24 +335,24 @@ func (Resource) Help() *markers.DefinitionHelp { }, FieldHelp: map[string]markers.DetailedHelp{ "Path": { - Summary: "specifies the plural \"resource\" for this CRD. ", - Details: "It generally corresponds to a plural, lower-cased version of the Kind. See https://book.kubebuilder.io/cronjob-tutorial/gvks.html.", + Summary: "specifies the plural \"resource\" for this CRD.", + Details: "It generally corresponds to a plural, lower-cased version of the Kind.\nSee https://book.kubebuilder.io/cronjob-tutorial/gvks.html.", }, "ShortName": { - Summary: "specifies aliases for this CRD. ", - Details: "Short names are often used when people have work with your resource over and over again. For instance, \"rs\" for \"replicaset\" or \"crd\" for customresourcedefinition.", + Summary: "specifies aliases for this CRD.", + Details: "Short names are often used when people have work with your resource\nover and over again. For instance, \"rs\" for \"replicaset\" or\n\"crd\" for customresourcedefinition.", }, "Categories": { - Summary: "specifies which group aliases this resource is part of. ", - Details: "Group aliases are used to work with groups of resources at once. The most common one is \"all\" which covers about a third of the base resources in Kubernetes, and is generally used for \"user-facing\" resources.", + Summary: "specifies which group aliases this resource is part of.", + Details: "Group aliases are used to work with groups of resources at once.\nThe most common one is \"all\" which covers about a third of the base\nresources in Kubernetes, and is generally used for \"user-facing\" resources.", }, "Singular": { - Summary: "overrides the singular form of your resource. ", + Summary: "overrides the singular form of your resource.", Details: "The singular form is otherwise defaulted off the plural (path).", }, "Scope": { - Summary: "overrides the scope of the CRD (Cluster vs Namespaced). ", - Details: "Scope defaults to \"Namespaced\". Cluster-scoped (\"Cluster\") resources don't exist in namespaces.", + Summary: "overrides the scope of the CRD (Cluster vs Namespaced).", + Details: "Scope defaults to \"Namespaced\". Cluster-scoped (\"Cluster\") resources\ndon't exist in namespaces.", }, }, } @@ -362,8 +362,8 @@ func (Schemaless) Help() *markers.DefinitionHelp { return &markers.DefinitionHelp{ Category: "CRD validation", DetailedHelp: markers.DetailedHelp{ - Summary: "marks a field as being a schemaless object. ", - Details: "Schemaless objects are not introspected, so you must provide any type and validation information yourself. One use for this tag is for embedding fields that hold JSONSchema typed objects. Because this field disables all type checking, it is recommended to be used only as a last resort.", + Summary: "marks a field as being a schemaless object.", + Details: "Schemaless objects are not introspected, so you must provide\nany type and validation information yourself. One use for this\ntag is for embedding fields that hold JSONSchema typed objects.\nBecause this field disables all type checking, it is recommended\nto be used only as a last resort.", }, FieldHelp: map[string]markers.DetailedHelp{}, } @@ -373,8 +373,8 @@ func (SkipVersion) Help() *markers.DefinitionHelp { return &markers.DefinitionHelp{ Category: "CRD", DetailedHelp: markers.DetailedHelp{ - Summary: "removes the particular version of the CRD from the CRDs spec. ", - Details: "This is useful if you need to skip generating and listing version entries for 'internal' resource versions, which typically exist if using the Kubernetes upstream conversion-gen tool.", + Summary: "removes the particular version of the CRD from the CRDs spec.", + Details: "This is useful if you need to skip generating and listing version entries\nfor 'internal' resource versions, which typically exist if using the\nKubernetes upstream conversion-gen tool.", }, FieldHelp: map[string]markers.DetailedHelp{}, } @@ -384,8 +384,8 @@ func (StorageVersion) Help() *markers.DefinitionHelp { return &markers.DefinitionHelp{ Category: "CRD", DetailedHelp: markers.DetailedHelp{ - Summary: "marks this version as the \"storage version\" for the CRD for conversion. ", - Details: "When conversion is enabled for a CRD (i.e. it's not a trivial-versions/single-version CRD), one version is set as the \"storage version\" to be stored in etcd. Attempting to store any other version will result in conversion to the storage version via a conversion webhook.", + Summary: "marks this version as the \"storage version\" for the CRD for conversion.", + Details: "When conversion is enabled for a CRD (i.e. it's not a trivial-versions/single-version CRD),\none version is set as the \"storage version\" to be stored in etcd. Attempting to store any\nother version will result in conversion to the storage version via a conversion webhook.", }, FieldHelp: map[string]markers.DetailedHelp{}, } @@ -395,8 +395,8 @@ func (StructType) Help() *markers.DefinitionHelp { return &markers.DefinitionHelp{ Category: "CRD processing", DetailedHelp: markers.DetailedHelp{ - Summary: "specifies the level of atomicity of the struct; i.e. whether each field in the struct is independent of the others, or all fields are treated as a single unit. ", - Details: "Possible values: \n - \"granular\": fields in the struct are independent of each other, and can be manipulated by different actors. This is the default behavior. \n - \"atomic\": all fields are treated as one unit. Any changes have to replace the entire struct.", + Summary: "specifies the level of atomicity of the struct;", + Details: "i.e. whether each field in the struct is independent of the others,\nor all fields are treated as a single unit.\n\n\nPossible values:\n\n\n - \"granular\": fields in the struct are independent of each other,\n and can be manipulated by different actors.\n This is the default behavior.\n\n\n - \"atomic\": all fields are treated as one unit.\n Any changes have to replace the entire struct.", }, FieldHelp: map[string]markers.DetailedHelp{}, } @@ -419,8 +419,8 @@ func (SubresourceScale) Help() *markers.DefinitionHelp { Details: "", }, "SelectorPath": { - Summary: "specifies the jsonpath to the pod label selector field for the scale's status. ", - Details: "The selector field must be the *string* form (serialized form) of a selector. Setting a pod label selector is necessary for your type to work with the HorizontalPodAutoscaler.", + Summary: "specifies the jsonpath to the pod label selector field for the scale's status.", + Details: "The selector field must be the *string* form (serialized form) of a selector.\nSetting a pod label selector is necessary for your type to work with the HorizontalPodAutoscaler.", }, }, } @@ -441,8 +441,8 @@ func (Type) Help() *markers.DefinitionHelp { return &markers.DefinitionHelp{ Category: "CRD validation", DetailedHelp: markers.DetailedHelp{ - Summary: "overrides the type for this field (which defaults to the equivalent of the Go type). ", - Details: "This generally must be paired with custom serialization. For example, the metav1.Time field would be marked as \"type: string\" and \"format: date-time\".", + Summary: "overrides the type for this field (which defaults to the equivalent of the Go type).", + Details: "This generally must be paired with custom serialization. For example, the\nmetav1.Time field would be marked as \"type: string\" and \"format: date-time\".", }, FieldHelp: map[string]markers.DetailedHelp{}, } @@ -463,7 +463,7 @@ func (UnservedVersion) Help() *markers.DefinitionHelp { return &markers.DefinitionHelp{ Category: "CRD", DetailedHelp: markers.DetailedHelp{ - Summary: "does not serve this version. ", + Summary: "does not serve this version.", Details: "This is useful if you need to drop support for a version in favor of a newer version.", }, FieldHelp: map[string]markers.DetailedHelp{}, @@ -474,8 +474,8 @@ func (XEmbeddedResource) Help() *markers.DefinitionHelp { return &markers.DefinitionHelp{ Category: "CRD validation", DetailedHelp: markers.DetailedHelp{ - Summary: "EmbeddedResource marks a fields as an embedded resource with apiVersion, kind and metadata fields. ", - Details: "An embedded resource is a value that has apiVersion, kind and metadata fields. They are validated implicitly according to the semantics of the currently running apiserver. It is not necessary to add any additional schema for these field, yet it is possible. This can be combined with PreserveUnknownFields.", + Summary: "EmbeddedResource marks a fields as an embedded resource with apiVersion, kind and metadata fields.", + Details: "An embedded resource is a value that has apiVersion, kind and metadata fields.\nThey are validated implicitly according to the semantics of the currently\nrunning apiserver. It is not necessary to add any additional schema for these\nfield, yet it is possible. This can be combined with PreserveUnknownFields.", }, FieldHelp: map[string]markers.DetailedHelp{}, } @@ -485,8 +485,8 @@ func (XIntOrString) Help() *markers.DefinitionHelp { return &markers.DefinitionHelp{ Category: "CRD validation", DetailedHelp: markers.DetailedHelp{ - Summary: "IntOrString marks a fields as an IntOrString. ", - Details: "This is required when applying patterns or other validations to an IntOrString field. Knwon information about the type is applied during the collapse phase and as such is not normally available during marker application.", + Summary: "IntOrString marks a fields as an IntOrString.", + Details: "This is required when applying patterns or other validations to an IntOrString\nfield. Knwon information about the type is applied during the collapse phase\nand as such is not normally available during marker application.", }, FieldHelp: map[string]markers.DetailedHelp{}, } @@ -496,8 +496,8 @@ func (XPreserveUnknownFields) Help() *markers.DefinitionHelp { return &markers.DefinitionHelp{ Category: "CRD processing", DetailedHelp: markers.DetailedHelp{ - Summary: "PreserveUnknownFields stops the apiserver from pruning fields which are not specified. ", - Details: "By default the apiserver drops unknown fields from the request payload during the decoding step. This marker stops the API server from doing so. It affects fields recursively, but switches back to normal pruning behaviour if nested properties or additionalProperties are specified in the schema. This can either be true or undefined. False is forbidden. \n NB: The kubebuilder:validation:XPreserveUnknownFields variant is deprecated in favor of the kubebuilder:pruning:PreserveUnknownFields variant. They function identically.", + Summary: "PreserveUnknownFields stops the apiserver from pruning fields which are not specified.", + Details: "By default the apiserver drops unknown fields from the request payload\nduring the decoding step. This marker stops the API server from doing so.\nIt affects fields recursively, but switches back to normal pruning behaviour\nif nested properties or additionalProperties are specified in the schema.\nThis can either be true or undefined. False\nis forbidden.\n\n\nNB: The kubebuilder:validation:XPreserveUnknownFields variant is deprecated\nin favor of the kubebuilder:pruning:PreserveUnknownFields variant. They function\nidentically.", }, FieldHelp: map[string]markers.DetailedHelp{}, } @@ -507,8 +507,8 @@ func (XValidation) Help() *markers.DefinitionHelp { return &markers.DefinitionHelp{ Category: "CRD validation", DetailedHelp: markers.DetailedHelp{ - Summary: "marks a field as requiring a value for which a given expression evaluates to true. ", - Details: "This marker may be repeated to specify multiple expressions, all of which must evaluate to true.", + Summary: "marks a field as requiring a value for which a given", + Details: "expression evaluates to true.\n\n\nThis marker may be repeated to specify multiple expressions, all of\nwhich must evaluate to true.", }, FieldHelp: map[string]markers.DetailedHelp{ "Rule": { @@ -519,6 +519,10 @@ func (XValidation) Help() *markers.DefinitionHelp { Summary: "", Details: "", }, + "MessageExpression": { + Summary: "", + Details: "", + }, }, } } diff --git a/pkg/crd/testdata/cronjob_types.go b/pkg/crd/testdata/cronjob_types.go index 9f2eae271..d1754a8d3 100644 --- a/pkg/crd/testdata/cronjob_types.go +++ b/pkg/crd/testdata/cronjob_types.go @@ -247,6 +247,10 @@ type CronJobSpec struct { // +kubebuilder:validation:XValidation:rule="true" StringWithEvenLength string `json:"stringWithEvenLength,omitempty"` + // Test of the expression-based validation with messageExpression marker. + // +kubebuilder:validation:XValidation:rule="self.size() % 2 == 0",messageExpression="'Length has to be even but is ' + len(self.stringWithEvenLengthAndMessageExpression) + ' instead'" + StringWithEvenLengthAndMessageExpression string `json:"stringWithEvenLengthAndMessageExpression,omitempty"` + // Checks that fixed-length arrays work Array [3]int `json:"array,omitempty"` @@ -336,7 +340,6 @@ type MinMaxObject struct { } type EmpiableObject struct { - // +kubebuilder:default=forty-two Foo string `json:"foo,omitempty"` Bar string `json:"bar,omitempty"` diff --git a/pkg/crd/testdata/testdata.kubebuilder.io_cronjobs.yaml b/pkg/crd/testdata/testdata.kubebuilder.io_cronjobs.yaml index b72ca0bd6..ef633766e 100644 --- a/pkg/crd/testdata/testdata.kubebuilder.io_cronjobs.yaml +++ b/pkg/crd/testdata/testdata.kubebuilder.io_cronjobs.yaml @@ -6805,6 +6805,13 @@ spec: - message: must have even length rule: self.size() % 2 == 0 - rule: "true" + stringWithEvenLengthAndMessageExpression: + description: Test of the expression-based validation with + messageExpression marker. + type: string + x-kubernetes-validations: + - messageExpression: "'Length has to be even but is ' + len(self.stringWithEvenLengthAndMessageExpression) + ' instead'" + rule: self.size() % 2 == 0 structWithSeveralFields: description: A struct that can only be entirely replaced properties: diff --git a/pkg/crd/zz_generated.markerhelp.go b/pkg/crd/zz_generated.markerhelp.go index 68b7619ad..c1aa3853f 100644 --- a/pkg/crd/zz_generated.markerhelp.go +++ b/pkg/crd/zz_generated.markerhelp.go @@ -33,20 +33,20 @@ func (Generator) Help() *markers.DefinitionHelp { }, FieldHelp: map[string]markers.DetailedHelp{ "IgnoreUnexportedFields": { - Summary: "indicates that we should skip unexported fields. ", + Summary: "indicates that we should skip unexported fields.", Details: "Left unspecified, the default is false.", }, "AllowDangerousTypes": { - Summary: "allows types which are usually omitted from CRD generation because they are not recommended. ", - Details: "Currently the following additional types are allowed when this is true: float32 float64 \n Left unspecified, the default is false", + Summary: "allows types which are usually omitted from CRD generation", + Details: "because they are not recommended.\n\n\nCurrently the following additional types are allowed when this is true:\nfloat32\nfloat64\n\n\nLeft unspecified, the default is false", }, "MaxDescLen": { - Summary: "specifies the maximum description length for fields in CRD's OpenAPI schema. ", - Details: "0 indicates drop the description for all fields completely. n indicates limit the description to at most n characters and truncate the description to closest sentence boundary if it exceeds n characters.", + Summary: "specifies the maximum description length for fields in CRD's OpenAPI schema.", + Details: "0 indicates drop the description for all fields completely.\nn indicates limit the description to at most n characters and truncate the description to\nclosest sentence boundary if it exceeds n characters.", }, "CRDVersions": { - Summary: "specifies the target API versions of the CRD type itself to generate. Defaults to v1. ", - Details: "Currently, the only supported value is v1. \n The first version listed will be assumed to be the \"default\" version and will not get a version suffix in the output filename. \n You'll need to use \"v1\" to get support for features like defaulting, along with an API server that supports it (Kubernetes 1.16+).", + Summary: "specifies the target API versions of the CRD type itself to", + Details: "generate. Defaults to v1.\n\n\nCurrently, the only supported value is v1.\n\n\nThe first version listed will be assumed to be the \"default\" version and\nwill not get a version suffix in the output filename.\n\n\nYou'll need to use \"v1\" to get support for features like defaulting,\nalong with an API server that supports it (Kubernetes 1.16+).", }, "GenerateEmbeddedObjectMeta": { Summary: "specifies if any embedded ObjectMeta in the CRD should be generated", @@ -60,6 +60,10 @@ func (Generator) Help() *markers.DefinitionHelp { Summary: "specifies the year to substitute for \" YEAR\" in the header file.", Details: "", }, + "DeprecatedV1beta1CompatibilityPreserveUnknownFields": { + Summary: "indicates whether", + Details: "or not we should turn off field pruning for this resource.\n\n\nSpecifies spec.preserveUnknownFields value that is false and omitted by default.\nThis value can only be specified for CustomResourceDefinitions that were created with\n`apiextensions.k8s.io/v1beta1`.\n\n\nThe field can be set for compatiblity reasons, although strongly discouraged, resource\nauthors should move to a structural OpenAPI schema instead.\n\n\nSee https://kubernetes.io/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definitions/#field-pruning\nfor more information about field pruning and v1beta1 resources compatibility.", + }, }, } } diff --git a/pkg/deepcopy/zz_generated.markerhelp.go b/pkg/deepcopy/zz_generated.markerhelp.go index 55df3bfab..081c06551 100644 --- a/pkg/deepcopy/zz_generated.markerhelp.go +++ b/pkg/deepcopy/zz_generated.markerhelp.go @@ -28,8 +28,8 @@ func (Generator) Help() *markers.DefinitionHelp { return &markers.DefinitionHelp{ Category: "", DetailedHelp: markers.DetailedHelp{ - Summary: "generates code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.", - Details: "", + Summary: "generates code containing DeepCopy, DeepCopyInto, and", + Details: "DeepCopyObject method implementations.", }, FieldHelp: map[string]markers.DetailedHelp{ "HeaderFile": { diff --git a/pkg/genall/zz_generated.markerhelp.go b/pkg/genall/zz_generated.markerhelp.go index 6f58013b2..998061b9b 100644 --- a/pkg/genall/zz_generated.markerhelp.go +++ b/pkg/genall/zz_generated.markerhelp.go @@ -28,7 +28,7 @@ func (InputPaths) Help() *markers.DefinitionHelp { return &markers.DefinitionHelp{ Category: "", DetailedHelp: markers.DetailedHelp{ - Summary: "represents paths and go-style path patterns to use as package roots. ", + Summary: "represents paths and go-style path patterns to use as package roots.", Details: "Multiple paths can be specified using \"{path1, path2, path3}\".", }, FieldHelp: map[string]markers.DetailedHelp{}, @@ -39,8 +39,8 @@ func (OutputArtifacts) Help() *markers.DefinitionHelp { return &markers.DefinitionHelp{ Category: "", DetailedHelp: markers.DetailedHelp{ - Summary: "outputs artifacts to different locations, depending on whether they're package-associated or not. ", - Details: "Non-package associated artifacts are output to the Config directory, while package-associated ones are output to their package's source files' directory, unless an alternate path is specified in Code.", + Summary: "outputs artifacts to different locations, depending on", + Details: "whether they're package-associated or not.\n\n\nNon-package associated artifacts\nare output to the Config directory, while package-associated ones are output\nto their package's source files' directory, unless an alternate path is\nspecified in Code.", }, FieldHelp: map[string]markers.DetailedHelp{ "Config": { @@ -59,8 +59,8 @@ func (OutputToDirectory) Help() *markers.DefinitionHelp { return &markers.DefinitionHelp{ Category: "", DetailedHelp: markers.DetailedHelp{ - Summary: "outputs each artifact to the given directory, regardless of if it's package-associated or not.", - Details: "", + Summary: "outputs each artifact to the given directory, regardless", + Details: "of if it's package-associated or not.", }, FieldHelp: map[string]markers.DetailedHelp{}, } @@ -81,7 +81,7 @@ func (outputToStdout) Help() *markers.DefinitionHelp { return &markers.DefinitionHelp{ Category: "", DetailedHelp: markers.DetailedHelp{ - Summary: "outputs everything to standard-out, with no separation. ", + Summary: "outputs everything to standard-out, with no separation.", Details: "Generally useful for single-artifact outputs.", }, FieldHelp: map[string]markers.DetailedHelp{}, diff --git a/pkg/rbac/zz_generated.markerhelp.go b/pkg/rbac/zz_generated.markerhelp.go index 5a83941c3..20c707b1d 100644 --- a/pkg/rbac/zz_generated.markerhelp.go +++ b/pkg/rbac/zz_generated.markerhelp.go @@ -65,8 +65,8 @@ func (Rule) Help() *markers.DefinitionHelp { Details: "", }, "ResourceNames": { - Summary: "specifies the names of the API resources that this rule encompasses. ", - Details: "Create requests cannot be restricted by resourcename, as the object's name is not known at authorization time.", + Summary: "specifies the names of the API resources that this rule encompasses.", + Details: "Create requests cannot be restricted by resourcename, as the object's name\nis not known at authorization time.", }, "Verbs": { Summary: "specifies the (lowercase) kubernetes API verbs that this rule encompasses.", @@ -77,8 +77,8 @@ func (Rule) Help() *markers.DefinitionHelp { Details: "", }, "Namespace": { - Summary: "specifies the scope of the Rule. If not set, the Rule belongs to the generated ClusterRole. If set, the Rule belongs to a Role, whose namespace is specified by this field.", - Details: "", + Summary: "specifies the scope of the Rule.", + Details: "If not set, the Rule belongs to the generated ClusterRole.\nIf set, the Rule belongs to a Role, whose namespace is specified by this field.", }, }, } diff --git a/pkg/schemapatcher/zz_generated.markerhelp.go b/pkg/schemapatcher/zz_generated.markerhelp.go index 6e1d5a18c..db4cdb074 100644 --- a/pkg/schemapatcher/zz_generated.markerhelp.go +++ b/pkg/schemapatcher/zz_generated.markerhelp.go @@ -28,8 +28,8 @@ func (Generator) Help() *markers.DefinitionHelp { return &markers.DefinitionHelp{ Category: "", DetailedHelp: markers.DetailedHelp{ - Summary: "patches existing CRDs with new schemata. ", - Details: "It will generate output for each \"CRD Version\" (API version of the CRD type itself) , e.g. apiextensions/v1) available.", + Summary: "patches existing CRDs with new schemata.", + Details: "It will generate output for each \"CRD Version\" (API version of the CRD type\nitself) , e.g. apiextensions/v1) available.", }, FieldHelp: map[string]markers.DetailedHelp{ "ManifestsPath": { @@ -37,8 +37,8 @@ func (Generator) Help() *markers.DefinitionHelp { Details: "", }, "MaxDescLen": { - Summary: "specifies the maximum description length for fields in CRD's OpenAPI schema. ", - Details: "0 indicates drop the description for all fields completely. n indicates limit the description to at most n characters and truncate the description to closest sentence boundary if it exceeds n characters.", + Summary: "specifies the maximum description length for fields in CRD's OpenAPI schema.", + Details: "0 indicates drop the description for all fields completely.\nn indicates limit the description to at most n characters and truncate the description to\nclosest sentence boundary if it exceeds n characters.", }, "GenerateEmbeddedObjectMeta": { Summary: "specifies if any embedded ObjectMeta in the CRD should be generated", diff --git a/pkg/webhook/zz_generated.markerhelp.go b/pkg/webhook/zz_generated.markerhelp.go index 4dae86046..d40bcc81f 100644 --- a/pkg/webhook/zz_generated.markerhelp.go +++ b/pkg/webhook/zz_generated.markerhelp.go @@ -28,29 +28,29 @@ func (Config) Help() *markers.DefinitionHelp { return &markers.DefinitionHelp{ Category: "Webhook", DetailedHelp: markers.DetailedHelp{ - Summary: "specifies how a webhook should be served. ", - Details: "It specifies only the details that are intrinsic to the application serving it (e.g. the resources it can handle, or the path it serves on).", + Summary: "specifies how a webhook should be served.", + Details: "It specifies only the details that are intrinsic to the application serving\nit (e.g. the resources it can handle, or the path it serves on).", }, FieldHelp: map[string]markers.DetailedHelp{ "Mutating": { - Summary: "marks this as a mutating webhook (it's validating only if false) ", - Details: "Mutating webhooks are allowed to change the object in their response, and are called *before* all validating webhooks. Mutating webhooks may choose to reject an object, similarly to a validating webhook.", + Summary: "marks this as a mutating webhook (it's validating only if false)", + Details: "Mutating webhooks are allowed to change the object in their response,\nand are called *before* all validating webhooks. Mutating webhooks may\nchoose to reject an object, similarly to a validating webhook.", }, "FailurePolicy": { - Summary: "specifies what should happen if the API server cannot reach the webhook. ", - Details: "It may be either \"ignore\" (to skip the webhook and continue on) or \"fail\" (to reject the object in question).", + Summary: "specifies what should happen if the API server cannot reach the webhook.", + Details: "It may be either \"ignore\" (to skip the webhook and continue on) or \"fail\" (to reject\nthe object in question).", }, "MatchPolicy": { - Summary: "defines how the \"rules\" list is used to match incoming requests. Allowed values are \"Exact\" (match only if it exactly matches the specified rule) or \"Equivalent\" (match a request if it modifies a resource listed in rules, even via another API group or version).", - Details: "", + Summary: "defines how the \"rules\" list is used to match incoming requests.", + Details: "Allowed values are \"Exact\" (match only if it exactly matches the specified rule)\nor \"Equivalent\" (match a request if it modifies a resource listed in rules, even via another API group or version).", }, "SideEffects": { - Summary: "specify whether calling the webhook will have side effects. This has an impact on dry runs and `kubectl diff`: if the sideEffect is \"Unknown\" (the default) or \"Some\", then the API server will not call the webhook on a dry-run request and fails instead. If the value is \"None\", then the webhook has no side effects and the API server will call it on dry-run. If the value is \"NoneOnDryRun\", then the webhook is responsible for inspecting the \"dryRun\" property of the AdmissionReview sent in the request, and avoiding side effects if that value is \"true.\"", - Details: "", + Summary: "specify whether calling the webhook will have side effects.", + Details: "This has an impact on dry runs and `kubectl diff`: if the sideEffect is \"Unknown\" (the default) or \"Some\", then\nthe API server will not call the webhook on a dry-run request and fails instead.\nIf the value is \"None\", then the webhook has no side effects and the API server will call it on dry-run.\nIf the value is \"NoneOnDryRun\", then the webhook is responsible for inspecting the \"dryRun\" property of the\nAdmissionReview sent in the request, and avoiding side effects if that value is \"true.\"", }, "TimeoutSeconds": { - Summary: "allows configuring how long the API server should wait for a webhook to respond before treating the call as a failure. If the timeout expires before the webhook responds, the webhook call will be ignored or the API call will be rejected based on the failure policy. The timeout value must be between 1 and 30 seconds. The timeout for an admission webhook defaults to 10 seconds.", - Details: "", + Summary: "allows configuring how long the API server should wait for a webhook to respond before treating the call as a failure.", + Details: "If the timeout expires before the webhook responds, the webhook call will be ignored or the API call will be rejected based on the failure policy.\nThe timeout value must be between 1 and 30 seconds.\nThe timeout for an admission webhook defaults to 10 seconds.", }, "Groups": { Summary: "specifies the API groups that this webhook receives requests for.", @@ -61,8 +61,8 @@ func (Config) Help() *markers.DefinitionHelp { Details: "", }, "Verbs": { - Summary: "specifies the Kubernetes API verbs that this webhook receives requests for. ", - Details: "Only modification-like verbs may be specified. May be \"create\", \"update\", \"delete\", \"connect\", or \"*\" (for all).", + Summary: "specifies the Kubernetes API verbs that this webhook receives requests for.", + Details: "Only modification-like verbs may be specified.\nMay be \"create\", \"update\", \"delete\", \"connect\", or \"*\" (for all).", }, "Versions": { Summary: "specifies the API versions that this webhook receives requests for.", @@ -73,20 +73,24 @@ func (Config) Help() *markers.DefinitionHelp { Details: "", }, "Path": { - Summary: "specifies that path that the API server should connect to this webhook on. Must be prefixed with a '/validate-' or '/mutate-' depending on the type, and followed by $GROUP-$VERSION-$KIND where all values are lower-cased and the periods in the group are substituted for hyphens. For example, a validating webhook path for type batch.tutorial.kubebuilder.io/v1,Kind=CronJob would be /validate-batch-tutorial-kubebuilder-io-v1-cronjob", - Details: "", + Summary: "specifies that path that the API server should connect to this webhook on. Must be", + Details: "prefixed with a '/validate-' or '/mutate-' depending on the type, and followed by\n$GROUP-$VERSION-$KIND where all values are lower-cased and the periods in the group\nare substituted for hyphens. For example, a validating webhook path for type\nbatch.tutorial.kubebuilder.io/v1,Kind=CronJob would be\n/validate-batch-tutorial-kubebuilder-io-v1-cronjob", }, "WebhookVersions": { - Summary: "specifies the target API versions of the {Mutating,Validating}WebhookConfiguration objects itself to generate. The only supported value is v1. Defaults to v1.", - Details: "", + Summary: "specifies the target API versions of the {Mutating,Validating}WebhookConfiguration objects", + Details: "itself to generate. The only supported value is v1. Defaults to v1.", }, "AdmissionReviewVersions": { - Summary: "is an ordered list of preferred `AdmissionReview` versions the Webhook expects.", - Details: "", + Summary: "is an ordered list of preferred `AdmissionReview`", + Details: "versions the Webhook expects.", }, "ReinvocationPolicy": { - Summary: "allows mutating webhooks to request reinvocation after other mutations ", - Details: "To allow mutating admission plugins to observe changes made by other plugins, built-in mutating admission plugins are re-run if a mutating webhook modifies an object, and mutating webhooks can specify a reinvocationPolicy to control whether they are reinvoked as well.", + Summary: "allows mutating webhooks to request reinvocation after other mutations", + Details: "To allow mutating admission plugins to observe changes made by other plugins,\nbuilt-in mutating admission plugins are re-run if a mutating webhook modifies\nan object, and mutating webhooks can specify a reinvocationPolicy to control\nwhether they are reinvoked as well.", + }, + "URL": { + Summary: "allows mutating webhooks configuration to specify an external URL when generating", + Details: "the manifests, instead of using the internal service communication. Should be in format of\nhttps://address:port/path\nWhen this option is specified, the serviceConfig.Service is removed from webhook the manifest.\nThe URL configuration should be between quotes.\n`url` cannot be specified when `path` is specified.", }, }, } From 434b090a8ad0dbbc5a721cbb0cfff4bf3a05f386 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Apr 2024 01:20:01 +0000 Subject: [PATCH 31/33] :seedling: Bump tj-actions/changed-files from 44.0.1 to 44.3.0 Bumps [tj-actions/changed-files](https://github.com/tj-actions/changed-files) from 44.0.1 to 44.3.0. - [Release notes](https://github.com/tj-actions/changed-files/releases) - [Changelog](https://github.com/tj-actions/changed-files/blob/main/HISTORY.md) - [Commits](https://github.com/tj-actions/changed-files/compare/635f118699dd888d737c15018cd30aff2e0274f8...0874344d6ebbaa00a27da73276ae7162fadcaf69) --- updated-dependencies: - dependency-name: tj-actions/changed-files dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/tools-releases.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tools-releases.yml b/.github/workflows/tools-releases.yml index e93b0a6f9..91a89aa53 100644 --- a/.github/workflows/tools-releases.yml +++ b/.github/workflows/tools-releases.yml @@ -20,7 +20,7 @@ jobs: uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # tag=v4.1.2 - name: Get changed files id: changed-files - uses: tj-actions/changed-files@635f118699dd888d737c15018cd30aff2e0274f8 # tag=v44.0.1 + uses: tj-actions/changed-files@0874344d6ebbaa00a27da73276ae7162fadcaf69 # tag=v44.3.0 with: files: | hack/envtest/_matrix/*.yaml From 9571d3c9e5420f37f86bafbbbb91406ab04396d0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Apr 2024 01:51:56 +0000 Subject: [PATCH 32/33] :seedling: Bump github.com/onsi/gomega from 1.32.0 to 1.33.0 Bumps [github.com/onsi/gomega](https://github.com/onsi/gomega) from 1.32.0 to 1.33.0. - [Release notes](https://github.com/onsi/gomega/releases) - [Changelog](https://github.com/onsi/gomega/blob/master/CHANGELOG.md) - [Commits](https://github.com/onsi/gomega/compare/v1.32.0...v1.33.0) --- updated-dependencies: - dependency-name: github.com/onsi/gomega dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/go.mod b/go.mod index a59479598..281fe51c0 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ require ( github.com/gobuffalo/flect v1.0.2 github.com/google/go-cmp v0.6.0 github.com/onsi/ginkgo v1.16.5 - github.com/onsi/gomega v1.32.0 + github.com/onsi/gomega v1.33.0 github.com/spf13/cobra v1.8.0 github.com/spf13/pflag v1.0.5 golang.org/x/tools v0.20.0 diff --git a/go.sum b/go.sum index 97664c568..4d24303cf 100644 --- a/go.sum +++ b/go.sum @@ -63,12 +63,12 @@ github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+W github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= -github.com/onsi/ginkgo/v2 v2.15.0 h1:79HwNRBAZHOEwrczrgSOPy+eFTTlIGELKy5as+ClttY= -github.com/onsi/ginkgo/v2 v2.15.0/go.mod h1:HlxMHtYF57y6Dpf+mc5529KKmSq9h2FpCF+/ZkwUxKM= +github.com/onsi/ginkgo/v2 v2.17.1 h1:V++EzdbhI4ZV4ev0UTIj0PzhzOcReJFyJaLjtSF55M8= +github.com/onsi/ginkgo/v2 v2.17.1/go.mod h1:llBI3WDLL9Z6taip6f33H76YcWtJv+7R3HigUjbIBOs= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= -github.com/onsi/gomega v1.32.0 h1:JRYU78fJ1LPxlckP6Txi/EYqJvjtMrDC04/MM5XRHPk= -github.com/onsi/gomega v1.32.0/go.mod h1:a4x4gW6Pz2yK1MAmvluYme5lvYTn61afQ2ETw/8n4Lg= +github.com/onsi/gomega v1.33.0 h1:snPCflnZrpMsy94p4lXVEkHo12lmPnc3vY5XBbreexE= +github.com/onsi/gomega v1.33.0/go.mod h1:+925n5YtiFsLzzafLUHzVMBpvvRAzrydIBiSIxjX3wY= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= From 1381be7bb92c5819b9293bcc4cc1ff95f2e85e3a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Apr 2024 06:15:12 +0000 Subject: [PATCH 33/33] :seedling: Bump actions/checkout from 4.1.2 to 4.1.3 Bumps [actions/checkout](https://github.com/actions/checkout) from 4.1.2 to 4.1.3. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/9bb56186c3b09b4f86b1c65136769dd318469633...1d96c772d19495a3b5c517cd2bc0cb401ea0529f) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/golangci-lint.yml | 2 +- .github/workflows/pr-dependabot.yaml | 2 +- .github/workflows/tools-releases.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index 83193a5fc..3d9e3fda0 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -28,7 +28,7 @@ jobs: with: go-version: "1.22" cache: false - - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # tag=v4.1.2 + - uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # tag=v4.1.3 - name: golangci-lint uses: golangci/golangci-lint-action@3cfe3a4abbb849e10058ce4af15d205b6da42804 # tag=v4.0.0 with: diff --git a/.github/workflows/pr-dependabot.yaml b/.github/workflows/pr-dependabot.yaml index c5e7d6d80..0bb792081 100644 --- a/.github/workflows/pr-dependabot.yaml +++ b/.github/workflows/pr-dependabot.yaml @@ -19,7 +19,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out code - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # tag=v4.1.2 + uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # tag=v4.1.3 - name: Set up Go uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # tag=v5.0.0 with: diff --git a/.github/workflows/tools-releases.yml b/.github/workflows/tools-releases.yml index 91a89aa53..a652a8c13 100644 --- a/.github/workflows/tools-releases.yml +++ b/.github/workflows/tools-releases.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # tag=v4.1.2 + uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # tag=v4.1.3 - name: Get changed files id: changed-files uses: tj-actions/changed-files@0874344d6ebbaa00a27da73276ae7162fadcaf69 # tag=v44.3.0