diff --git a/go.mod b/go.mod index 0f9855f7..a7a6c6fc 100644 --- a/go.mod +++ b/go.mod @@ -2,22 +2,22 @@ module go.bytebuilders.dev/audit go 1.22.1 -toolchain go1.22.4 +toolchain go1.22.5 require ( github.com/cloudevents/sdk-go/v2 v2.15.2 - github.com/nats-io/nats.go v1.35.0 + github.com/nats-io/nats.go v1.36.0 github.com/pkg/errors v0.9.1 go.bytebuilders.dev/license-verifier v0.14.1 go.bytebuilders.dev/license-verifier/kubernetes v0.14.1 gomodules.xyz/counter v0.0.1 gomodules.xyz/sync v0.1.0 - k8s.io/api v0.30.1 - k8s.io/apimachinery v0.30.1 - k8s.io/client-go v0.30.1 - k8s.io/klog/v2 v2.120.1 - kmodules.xyz/client-go v0.30.5 - kmodules.xyz/resource-metadata v0.18.8-0.20240614001230-063fb3a89196 + k8s.io/api v0.30.2 + k8s.io/apimachinery v0.30.2 + k8s.io/client-go v0.30.2 + k8s.io/klog/v2 v2.130.1 + kmodules.xyz/client-go v0.30.9 + kmodules.xyz/resource-metadata v0.18.10 sigs.k8s.io/controller-runtime v0.18.4 ) @@ -87,7 +87,7 @@ require ( github.com/yudai/gojsondiff v1.0.0 // indirect github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82 // indirect github.com/zeebo/xxh3 v1.0.2 // indirect - go.bytebuilders.dev/license-proxyserver v0.0.8 // indirect + go.bytebuilders.dev/license-proxyserver v0.0.11 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.26.0 // indirect golang.org/x/crypto v0.22.0 // indirect @@ -113,7 +113,7 @@ require ( k8s.io/apiextensions-apiserver v0.30.1 // indirect k8s.io/apiserver v0.30.1 // indirect k8s.io/kube-aggregator v0.30.1 // indirect - k8s.io/kube-openapi v0.0.0-20240521193020-835d969ad83a // indirect + k8s.io/kube-openapi v0.0.0-20240430033511-f0e62f92d13f // indirect k8s.io/utils v0.0.0-20240102154912-e7106e64919e // indirect kmodules.xyz/apiversion v0.2.0 // indirect kmodules.xyz/go-containerregistry v0.0.12 // indirect diff --git a/go.sum b/go.sum index ca1ea70b..9fafb323 100644 --- a/go.sum +++ b/go.sum @@ -131,8 +131,8 @@ github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9G github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= -github.com/nats-io/nats.go v1.35.0 h1:XFNqNM7v5B+MQMKqVGAyHwYhyKb48jrenXNxIU20ULk= -github.com/nats-io/nats.go v1.35.0/go.mod h1:Ubdu4Nh9exXdSz0RVWRFBbRfrbSxOYd26oF0wkWclB8= +github.com/nats-io/nats.go v1.36.0 h1:suEUPuWzTSse/XhESwqLxXGuj8vGRuPRoG7MoRN/qyU= +github.com/nats-io/nats.go v1.36.0/go.mod h1:Ubdu4Nh9exXdSz0RVWRFBbRfrbSxOYd26oF0wkWclB8= github.com/nats-io/nkeys v0.4.7 h1:RwNJbbIdYCoClSDNY7QVKZlyb/wfT6ugvFCiKy6vDvI= github.com/nats-io/nkeys v0.4.7/go.mod h1:kqXRgRDPlGy7nGaEDMuYzmiJCIAAWDK0IMBtDmGD0nc= github.com/nats-io/nuid v1.0.1 h1:5iA8DT8V7q8WK2EScv2padNa/rTESc1KdnPw4TC2paw= @@ -207,8 +207,8 @@ github.com/zeebo/assert v1.3.0 h1:g7C04CbJuIDKNPFHmsk4hwZDO5O+kntRxzaUoNXj+IQ= github.com/zeebo/assert v1.3.0/go.mod h1:Pq9JiuJQpG8JLJdtkwrJESF0Foym2/D9XMU5ciN/wJ0= github.com/zeebo/xxh3 v1.0.2 h1:xZmwmqxHZA8AI603jOQ0tMqmBr9lPeFwGg6d+xy9DC0= github.com/zeebo/xxh3 v1.0.2/go.mod h1:5NWz9Sef7zIDm2JHfFlcQvNekmcEl9ekUZQQKCYaDcA= -go.bytebuilders.dev/license-proxyserver v0.0.8 h1:ecyABB372OoHW5yUsbUOrzUu2GyfYHNeDuIf+3GhZ8w= -go.bytebuilders.dev/license-proxyserver v0.0.8/go.mod h1:YBrtuYpz0myGBBPNh3B8UBNFZJ8aj95ovZQckgXSjRY= +go.bytebuilders.dev/license-proxyserver v0.0.11 h1:6GRprMFK3V2liKubajGOO0cUhTWjmwj6VvMzfiRs+iQ= +go.bytebuilders.dev/license-proxyserver v0.0.11/go.mod h1:IBioC86i4anWR1SF9lHR3qgUiNcihpyEijHLVSavsnk= go.bytebuilders.dev/license-verifier v0.14.1 h1:Pk0a4NKgRjMt6eBZATHwLmPUuTQL00kQB3AQoxhCsUE= go.bytebuilders.dev/license-verifier v0.14.1/go.mod h1:GB9XTSQUcllJ4AVq29TdJI6yRjoI86HGz0XMqq9nLwY= go.bytebuilders.dev/license-verifier/kubernetes v0.14.1 h1:bKCtI8dLYXN2oe0xkS7tu68Knepj16SOdyLUq2jHYfc= @@ -323,34 +323,34 @@ gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools/v3 v3.1.0 h1:rVV8Tcg/8jHUkPUorwjaMTtemIMVXfIPKiOqnhEhakk= gotest.tools/v3 v3.1.0/go.mod h1:fHy7eyTmJFO5bQbUsEGQ1v4m2J3Jz9eWL54TP2/ZuYQ= -k8s.io/api v0.30.1 h1:kCm/6mADMdbAxmIh0LBjS54nQBE+U4KmbCfIkF5CpJY= -k8s.io/api v0.30.1/go.mod h1:ddbN2C0+0DIiPntan/bye3SW3PdwLa11/0yqwvuRrJM= +k8s.io/api v0.30.2 h1:+ZhRj+28QT4UOH+BKznu4CBgPWgkXO7XAvMcMl0qKvI= +k8s.io/api v0.30.2/go.mod h1:ULg5g9JvOev2dG0u2hig4Z7tQ2hHIuS+m8MNZ+X6EmI= k8s.io/apiextensions-apiserver v0.30.1 h1:4fAJZ9985BmpJG6PkoxVRpXv9vmPUOVzl614xarePws= k8s.io/apiextensions-apiserver v0.30.1/go.mod h1:R4GuSrlhgq43oRY9sF2IToFh7PVlF1JjfWdoG3pixk4= -k8s.io/apimachinery v0.30.1 h1:ZQStsEfo4n65yAdlGTfP/uSHMQSoYzU/oeEbkmF7P2U= -k8s.io/apimachinery v0.30.1/go.mod h1:iexa2somDaxdnj7bha06bhb43Zpa6eWH8N8dbqVjTUc= +k8s.io/apimachinery v0.30.2 h1:fEMcnBj6qkzzPGSVsAZtQThU62SmQ4ZymlXRC5yFSCg= +k8s.io/apimachinery v0.30.2/go.mod h1:iexa2somDaxdnj7bha06bhb43Zpa6eWH8N8dbqVjTUc= k8s.io/apiserver v0.30.1 h1:BEWEe8bzS12nMtDKXzCF5Q5ovp6LjjYkSp8qOPk8LZ8= k8s.io/apiserver v0.30.1/go.mod h1:i87ZnQ+/PGAmSbD/iEKM68bm1D5reX8fO4Ito4B01mo= -k8s.io/client-go v0.30.1 h1:uC/Ir6A3R46wdkgCV3vbLyNOYyCJ8oZnjtJGKfytl/Q= -k8s.io/client-go v0.30.1/go.mod h1:wrAqLNs2trwiCH/wxxmT/x3hKVH9PuV0GGW0oDoHVqc= -k8s.io/klog/v2 v2.120.1 h1:QXU6cPEOIslTGvZaXvFWiP9VKyeet3sawzTOvdXb4Vw= -k8s.io/klog/v2 v2.120.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= +k8s.io/client-go v0.30.2 h1:sBIVJdojUNPDU/jObC+18tXWcTJVcwyqS9diGdWHk50= +k8s.io/client-go v0.30.2/go.mod h1:JglKSWULm9xlJLx4KCkfLLQ7XwtlbflV6uFFSHTMgVs= +k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= +k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= k8s.io/kube-aggregator v0.30.1 h1:ymR2BsxDacTKwzKTuNhGZttuk009c+oZbSeD+IPX5q4= k8s.io/kube-aggregator v0.30.1/go.mod h1:SFbqWsM6ea8dHd3mPLsZFzJHbjBOS5ykIgJh4znZ5iQ= -k8s.io/kube-openapi v0.0.0-20240521193020-835d969ad83a h1:zD1uj3Jf+mD4zmA7W+goE5TxDkI7OGJjBNBzq5fJtLA= -k8s.io/kube-openapi v0.0.0-20240521193020-835d969ad83a/go.mod h1:UxDHUPsUwTOOxSU+oXURfFBcAS6JwiRXTYqYwfuGowc= +k8s.io/kube-openapi v0.0.0-20240430033511-f0e62f92d13f h1:0LQagt0gDpKqvIkAMPaRGcXawNMouPECM1+F9BVxEaM= +k8s.io/kube-openapi v0.0.0-20240430033511-f0e62f92d13f/go.mod h1:S9tOR0FxgyusSNR+MboCuiDpVWkAifZvaYI1Q2ubgro= k8s.io/utils v0.0.0-20240102154912-e7106e64919e h1:eQ/4ljkx21sObifjzXwlPKpdGLrCfRziVtos3ofG/sQ= k8s.io/utils v0.0.0-20240102154912-e7106e64919e/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= kmodules.xyz/apiversion v0.2.0 h1:vAQYqZFm4xu4pbB1cAdHbFEPES6EQkcR4wc06xdTOWk= kmodules.xyz/apiversion v0.2.0/go.mod h1:oPX8g8LvlPdPX3Yc5YvCzJHQnw3YF/X4/jdW0b1am80= -kmodules.xyz/client-go v0.30.5 h1:Zgi25FXK52Y4Pe2Ei43oZ6QLgk+x0XXukmw1gtOx9Bs= -kmodules.xyz/client-go v0.30.5/go.mod h1:XL3PDQIXG4s3xNRL2SSxIvi8b2WyMGpn26dFnOBz0j4= +kmodules.xyz/client-go v0.30.9 h1:wiLivFlqVZOitAqLFEa1n53GkbYYOmiR8upjIHPHrYk= +kmodules.xyz/client-go v0.30.9/go.mod h1:XL3PDQIXG4s3xNRL2SSxIvi8b2WyMGpn26dFnOBz0j4= kmodules.xyz/go-containerregistry v0.0.12 h1:Tl32QGmSqRVm9PUEb/f3dgDeu9zW5fVzt3qmAFIE37I= kmodules.xyz/go-containerregistry v0.0.12/go.mod h1:KgeNg0hDsgeda+qc0NzWk0iVRdF0+ZIg/oRzGoYh78I= kmodules.xyz/offshoot-api v0.29.4 h1:WQV2BIUIoVKKiqZNmZ4gAy367jEdwBhEl3dFCLZM1qA= kmodules.xyz/offshoot-api v0.29.4/go.mod h1:e+NQ0s4gW/YTPWBWEfdISZcmk+tlTq8IjvP5SLdqvko= -kmodules.xyz/resource-metadata v0.18.8-0.20240614001230-063fb3a89196 h1:eoZfQGKevjUl0A1Xvry3STD1uufj1Na9IquZVJ44rvo= -kmodules.xyz/resource-metadata v0.18.8-0.20240614001230-063fb3a89196/go.mod h1:sfb7uQ6H/XvL/AWqRZCBhRf+gO+NB3vmyPOoD6LVEys= +kmodules.xyz/resource-metadata v0.18.10 h1:B0DAMsJJBuSOGCKzptZvB8AWcbxzDdUm+3CIE7g9ftE= +kmodules.xyz/resource-metadata v0.18.10/go.mod h1:PXyZXif1b1QRpe0Pwr92OeOveptZricB0jLssCjsYTc= kmodules.xyz/resource-metrics v0.30.1 h1:o7mVY8ZwSe5iEILy1eMG4EPZCli7mXZCkgQONjoY9uU= kmodules.xyz/resource-metrics v0.30.1/go.mod h1:UYcQQLN+3o8rNPQJwJa2D9bt5ihJCeo5bCDuQ4O3MPY= sigs.k8s.io/cli-utils v0.34.0 h1:zCUitt54f0/MYj/ajVFnG6XSXMhpZ72O/3RewIchW8w= diff --git a/vendor/github.com/nats-io/nats.go/README.md b/vendor/github.com/nats-io/nats.go/README.md index 976ed704..fd64d93d 100644 --- a/vendor/github.com/nats-io/nats.go/README.md +++ b/vendor/github.com/nats-io/nats.go/README.md @@ -31,7 +31,7 @@ When using or transitioning to Go modules support: ```bash # Go client latest or explicit version go get github.com/nats-io/nats.go/@latest -go get github.com/nats-io/nats.go/@v1.35.0 +go get github.com/nats-io/nats.go/@v1.36.0 # For latest NATS Server, add /v2 at the end go get github.com/nats-io/nats-server/v2 diff --git a/vendor/github.com/nats-io/nats.go/go_test.mod b/vendor/github.com/nats-io/nats.go/go_test.mod index 5dfd112f..f5b731dd 100644 --- a/vendor/github.com/nats-io/nats.go/go_test.mod +++ b/vendor/github.com/nats-io/nats.go/go_test.mod @@ -4,20 +4,20 @@ go 1.19 require ( github.com/golang/protobuf v1.4.2 - github.com/klauspost/compress v1.17.6 + github.com/klauspost/compress v1.17.8 github.com/nats-io/jwt v1.2.2 - github.com/nats-io/nats-server/v2 v2.10.11 + github.com/nats-io/nats-server/v2 v2.10.16 github.com/nats-io/nkeys v0.4.7 github.com/nats-io/nuid v1.0.1 go.uber.org/goleak v1.3.0 - golang.org/x/text v0.14.0 + golang.org/x/text v0.15.0 google.golang.org/protobuf v1.23.0 ) require ( github.com/minio/highwayhash v1.0.2 // indirect - github.com/nats-io/jwt/v2 v2.5.3 // indirect - golang.org/x/crypto v0.19.0 // indirect - golang.org/x/sys v0.17.0 // indirect + github.com/nats-io/jwt/v2 v2.5.7 // indirect + golang.org/x/crypto v0.23.0 // indirect + golang.org/x/sys v0.20.0 // indirect golang.org/x/time v0.5.0 // indirect ) diff --git a/vendor/github.com/nats-io/nats.go/go_test.sum b/vendor/github.com/nats-io/nats.go/go_test.sum index d28f0f62..f89d755b 100644 --- a/vendor/github.com/nats-io/nats.go/go_test.sum +++ b/vendor/github.com/nats-io/nats.go/go_test.sum @@ -10,16 +10,16 @@ github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMyw github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/klauspost/compress v1.17.6 h1:60eq2E/jlfwQXtvZEeBUYADs+BwKBWURIY+Gj2eRGjI= -github.com/klauspost/compress v1.17.6/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= +github.com/klauspost/compress v1.17.8 h1:YcnTYrq7MikUT7k0Yb5eceMmALQPYBW/Xltxn0NAMnU= +github.com/klauspost/compress v1.17.8/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/minio/highwayhash v1.0.2 h1:Aak5U0nElisjDCfPSG79Tgzkn2gl66NxOMspRrKnA/g= github.com/minio/highwayhash v1.0.2/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY= github.com/nats-io/jwt v1.2.2 h1:w3GMTO969dFg+UOKTmmyuu7IGdusK+7Ytlt//OYH/uU= github.com/nats-io/jwt v1.2.2/go.mod h1:/xX356yQA6LuXI9xWW7mZNpxgF2mBmGecH+Fj34sP5Q= -github.com/nats-io/jwt/v2 v2.5.3 h1:/9SWvzc6hTfamcgXJ3uYRpgj+QuY2aLNqRiqrKcrpEo= -github.com/nats-io/jwt/v2 v2.5.3/go.mod h1:iysuPemFcc7p4IoYots3IuELSI4EDe9Y0bQMe+I3Bf4= -github.com/nats-io/nats-server/v2 v2.10.11 h1:yKUiLVincZISpo3A4YljJQ+HfLltGAgoNNJl99KL8I0= -github.com/nats-io/nats-server/v2 v2.10.11/go.mod h1:dXtOqVWzbMTEj+tUyC/itXjJhW37xh0tUBrTAlqAfx8= +github.com/nats-io/jwt/v2 v2.5.7 h1:j5lH1fUXCnJnY8SsQeB/a/z9Azgu2bYIDvtPVNdxe2c= +github.com/nats-io/jwt/v2 v2.5.7/go.mod h1:ZdWS1nZa6WMZfFwwgpEaqBV8EPGVgOTDHN/wTbz0Y5A= +github.com/nats-io/nats-server/v2 v2.10.16 h1:2jXaiydp5oB/nAx/Ytf9fdCi9QN6ItIc9eehX8kwVV0= +github.com/nats-io/nats-server/v2 v2.10.16/go.mod h1:Pksi38H2+6xLe1vQx0/EA4bzetM0NqyIHcIbmgXSkIU= github.com/nats-io/nkeys v0.2.0/go.mod h1:XdZpAbhgyyODYqjTawOnIOI7VlbKSarI9Gfy1tqEu/s= github.com/nats-io/nkeys v0.4.7 h1:RwNJbbIdYCoClSDNY7QVKZlyb/wfT6ugvFCiKy6vDvI= github.com/nats-io/nkeys v0.4.7/go.mod h1:kqXRgRDPlGy7nGaEDMuYzmiJCIAAWDK0IMBtDmGD0nc= @@ -31,17 +31,17 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.19.0 h1:ENy+Az/9Y1vSrlrvBSyna3PITt4tiZLf7sgCjZBX7Wo= -golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= +golang.org/x/crypto v0.23.0 h1:dIJU/v2J8Mdglj/8rJ6UUOM3Zc9zLZxVZwwxMooUSAI= +golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/sys v0.0.0-20190130150945-aca44879d564/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.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.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= +golang.org/x/sys v0.20.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.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= -golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk= +golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= diff --git a/vendor/github.com/nats-io/nats.go/nats.go b/vendor/github.com/nats-io/nats.go/nats.go index befff781..d019cee4 100644 --- a/vendor/github.com/nats-io/nats.go/nats.go +++ b/vendor/github.com/nats-io/nats.go/nats.go @@ -47,7 +47,7 @@ import ( // Default Constants const ( - Version = "1.35.0" + Version = "1.36.0" DefaultURL = "nats://127.0.0.1:4222" DefaultPort = 4222 DefaultMaxReconnect = 60 @@ -5483,7 +5483,7 @@ func (nc *Conn) drainConnection() { // Drain will put a connection into a drain state. All subscriptions will // immediately be put into a drain state. Upon completion, the publishers // will be drained and can not publish any additional messages. Upon draining -// of the publishers, the connection will be closed. Use the ClosedCB() +// of the publishers, the connection will be closed. Use the ClosedCB // option to know when the connection has moved from draining to closed. // // See note in Subscription.Drain for JetStream subscriptions. diff --git a/vendor/k8s.io/klog/v2/klog.go b/vendor/k8s.io/klog/v2/klog.go index 026be9e3..47ec9466 100644 --- a/vendor/k8s.io/klog/v2/klog.go +++ b/vendor/k8s.io/klog/v2/klog.go @@ -404,13 +404,6 @@ func (t *traceLocation) Set(value string) error { return nil } -// flushSyncWriter is the interface satisfied by logging destinations. -type flushSyncWriter interface { - Flush() error - Sync() error - io.Writer -} - var logging loggingT var commandLine flag.FlagSet @@ -486,7 +479,7 @@ type settings struct { // Access to all of the following fields must be protected via a mutex. // file holds writer for each of the log types. - file [severity.NumSeverity]flushSyncWriter + file [severity.NumSeverity]io.Writer // flushInterval is the interval for periodic flushing. If zero, // the global default will be used. flushInterval time.Duration @@ -831,32 +824,12 @@ func (l *loggingT) printS(err error, s severity.Severity, depth int, msg string, buffer.PutBuffer(b) } -// redirectBuffer is used to set an alternate destination for the logs -type redirectBuffer struct { - w io.Writer -} - -func (rb *redirectBuffer) Sync() error { - return nil -} - -func (rb *redirectBuffer) Flush() error { - return nil -} - -func (rb *redirectBuffer) Write(bytes []byte) (n int, err error) { - return rb.w.Write(bytes) -} - // SetOutput sets the output destination for all severities func SetOutput(w io.Writer) { logging.mu.Lock() defer logging.mu.Unlock() for s := severity.FatalLog; s >= severity.InfoLog; s-- { - rb := &redirectBuffer{ - w: w, - } - logging.file[s] = rb + logging.file[s] = w } } @@ -868,10 +841,7 @@ func SetOutputBySeverity(name string, w io.Writer) { if !ok { panic(fmt.Sprintf("SetOutputBySeverity(%q): unrecognized severity name", name)) } - rb := &redirectBuffer{ - w: w, - } - logging.file[sev] = rb + logging.file[sev] = w } // LogToStderr sets whether to log exclusively to stderr, bypassing outputs @@ -1011,7 +981,8 @@ func (l *loggingT) exit(err error) { logExitFunc(err) return } - l.flushAll() + needToSync := l.flushAll() + l.syncAll(needToSync) OsExit(2) } @@ -1028,10 +999,6 @@ type syncBuffer struct { maxbytes uint64 // The max number of bytes this syncBuffer.file can hold before cleaning up. } -func (sb *syncBuffer) Sync() error { - return sb.file.Sync() -} - // CalculateMaxSize returns the real max size in bytes after considering the default max size and the flag options. func CalculateMaxSize() uint64 { if logging.logFile != "" { @@ -1223,24 +1190,45 @@ func StartFlushDaemon(interval time.Duration) { // lockAndFlushAll is like flushAll but locks l.mu first. func (l *loggingT) lockAndFlushAll() { l.mu.Lock() - l.flushAll() + needToSync := l.flushAll() l.mu.Unlock() + // Some environments are slow when syncing and holding the lock might cause contention. + l.syncAll(needToSync) } -// flushAll flushes all the logs and attempts to "sync" their data to disk. +// flushAll flushes all the logs // l.mu is held. -func (l *loggingT) flushAll() { +// +// The result is the number of files which need to be synced and the pointers to them. +func (l *loggingT) flushAll() fileArray { + var needToSync fileArray + // Flush from fatal down, in case there's trouble flushing. for s := severity.FatalLog; s >= severity.InfoLog; s-- { file := l.file[s] - if file != nil { - _ = file.Flush() // ignore error - _ = file.Sync() // ignore error + if sb, ok := file.(*syncBuffer); ok && sb.file != nil { + _ = sb.Flush() // ignore error + needToSync.files[needToSync.num] = sb.file + needToSync.num++ } } if logging.loggerOptions.flush != nil { logging.loggerOptions.flush() } + return needToSync +} + +type fileArray struct { + num int + files [severity.NumSeverity]*os.File +} + +// syncAll attempts to "sync" their data to disk. +func (l *loggingT) syncAll(needToSync fileArray) { + // Flush from fatal down, in case there's trouble flushing. + for i := 0; i < needToSync.num; i++ { + _ = needToSync.files[i].Sync() // ignore error + } } // CopyStandardLogTo arranges for messages written to the Go "log" package's diff --git a/vendor/kmodules.xyz/client-go/api/v1/cluster.go b/vendor/kmodules.xyz/client-go/api/v1/cluster.go index ed13da08..057cb55a 100644 --- a/vendor/kmodules.xyz/client-go/api/v1/cluster.go +++ b/vendor/kmodules.xyz/client-go/api/v1/cluster.go @@ -26,6 +26,7 @@ const ( HostingProviderAzure HostingProvider = "Azure" HostingProviderDigitalOcean HostingProvider = "DigitalOcean" HostingProviderGoogleCloud HostingProvider = "GoogleCloud" + HostingProviderExoscale HostingProvider = "Exoscale" HostingProviderLinode HostingProvider = "Linode" HostingProviderPacket HostingProvider = "Packet" HostingProviderScaleway HostingProvider = "Scaleway" diff --git a/vendor/kmodules.xyz/client-go/api/v1/resource.go b/vendor/kmodules.xyz/client-go/api/v1/resource.go index 4fc78c8e..b03e80f8 100644 --- a/vendor/kmodules.xyz/client-go/api/v1/resource.go +++ b/vendor/kmodules.xyz/client-go/api/v1/resource.go @@ -18,6 +18,7 @@ package v1 import ( "fmt" + "strings" "k8s.io/apimachinery/pkg/api/meta" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -68,6 +69,14 @@ func (r ResourceID) GroupVersionKind() schema.GroupVersionKind { return schema.GroupVersionKind{Group: r.Group, Version: r.Version, Kind: r.Kind} } +func (r ResourceID) ListGroupVersionKind() schema.GroupVersionKind { + kind := r.Kind + "List" + if strings.HasSuffix(r.Kind, "List") { + kind = r.Kind + } + return schema.GroupVersionKind{Group: r.Group, Version: r.Version, Kind: kind} +} + func (r ResourceID) MetaGVR() metav1.GroupVersionResource { return metav1.GroupVersionResource{Group: r.Group, Version: r.Version, Resource: r.Name} } diff --git a/vendor/kmodules.xyz/client-go/apiextensions/controller.go b/vendor/kmodules.xyz/client-go/apiextensions/controller.go index 94425010..6d3d66a6 100644 --- a/vendor/kmodules.xyz/client-go/apiextensions/controller.go +++ b/vendor/kmodules.xyz/client-go/apiextensions/controller.go @@ -20,21 +20,29 @@ import ( "context" "sync" - apiextensions "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" + apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" + "k8s.io/apimachinery/pkg/api/meta" "k8s.io/apimachinery/pkg/runtime/schema" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/log" ) -type SetupFn func(ctx context.Context, mgr ctrl.Manager) +type ( + SetupFn func(context.Context, ctrl.Manager) + TestFn func(meta.RESTMapper, *apiextensionsv1.CustomResourceDefinition) bool +) -var setupFns = map[schema.GroupKind]SetupFn{ - // schema.GroupKind{"compute.gcp.kubedb.com", "Firewall"}: firewall.Setup, +type setupGroup struct { + gks []schema.GroupKind + fn SetupFn } var ( + setupFns = make(map[schema.GroupKind]setupGroup) + testFns = make(map[schema.GroupKind]TestFn) setupDone = map[schema.GroupKind]bool{} + CRDParam = struct{}{} mu sync.Mutex ) @@ -49,7 +57,7 @@ func NewReconciler(ctx context.Context, mgr ctrl.Manager) *Reconciler { func (r *Reconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) { log := log.FromContext(ctx) - var crd apiextensions.CustomResourceDefinition + var crd apiextensionsv1.CustomResourceDefinition if err := r.mgr.GetClient().Get(ctx, req.NamespacedName, &crd); err != nil { log.Error(err, "unable to fetch CustomResourceDefinition") return ctrl.Result{}, client.IgnoreNotFound(err) @@ -65,9 +73,19 @@ func (r *Reconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Resu if found { return ctrl.Result{}, nil } - setup, found := setupFns[gk] - if found { - setup(r.ctx, r.mgr) + + setup, setupFnExists := setupFns[gk] + if !setupFnExists { + return ctrl.Result{}, nil + } + if !testFns[gk](r.mgr.GetRESTMapper(), &crd) { + return ctrl.Result{}, nil + } + + ctxSetup := context.WithValue(r.ctx, CRDParam, &crd) + setup.fn(ctxSetup, r.mgr) + + for _, gk := range setup.gks { setupDone[gk] = true } return ctrl.Result{}, nil @@ -75,13 +93,58 @@ func (r *Reconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Resu func (r *Reconciler) SetupWithManager(mgr ctrl.Manager) error { return ctrl.NewControllerManagedBy(mgr). - For(&apiextensions.CustomResourceDefinition{}). + For(&apiextensionsv1.CustomResourceDefinition{}). Complete(r) } -func RegisterSetup(gk schema.GroupKind, fn SetupFn) { +func RegisterSetup(gk schema.GroupKind, fn SetupFn, tn ...TestFn) { + mu.Lock() + defer mu.Unlock() + + setupFns[gk] = setupGroup{ + gks: []schema.GroupKind{gk}, + fn: fn, + } + testFns[gk] = andTestFn(tn...) +} + +func MultiRegisterSetup(gks []schema.GroupKind, fn SetupFn, tn ...TestFn) { mu.Lock() defer mu.Unlock() - setupFns[gk] = fn + testFN := andTestFn(append(tn, allCRDPresent(gks))...) + for _, gk := range gks { + setupFns[gk] = setupGroup{ + gks: gks, + fn: fn, + } + testFns[gk] = testFN + } +} + +func allCRDPresent(gks []schema.GroupKind) TestFn { + return func(mapper meta.RESTMapper, definition *apiextensionsv1.CustomResourceDefinition) bool { + for _, gk := range gks { + if !crdFound(mapper, gk) { + return false + } + } + return true + } +} + +func crdFound(mapper meta.RESTMapper, gk schema.GroupKind) bool { + _, err := mapper.RESTMappings(gk) + return err == nil +} + +func andTestFn(fns ...TestFn) TestFn { + return func(mapper meta.RESTMapper, crd *apiextensionsv1.CustomResourceDefinition) bool { + for _, fn := range fns { + if !fn(mapper, crd) { + return false + } + } + return true + } } diff --git a/vendor/kmodules.xyz/client-go/cluster/detector.go b/vendor/kmodules.xyz/client-go/cluster/detector.go new file mode 100644 index 00000000..b7ca7231 --- /dev/null +++ b/vendor/kmodules.xyz/client-go/cluster/detector.go @@ -0,0 +1,115 @@ +/* +Copyright AppsCode Inc. and Contributors + +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 cluster + +import ( + "crypto/tls" + "crypto/x509" + "fmt" + "net" + "net/http" + "strings" + "time" + + kmapi "kmodules.xyz/client-go/api/v1" + + "k8s.io/apimachinery/pkg/api/meta" + "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/client-go/rest" +) + +const ( + aksDomain = ".azmk8s.io" + eksDomain = ".eks.amazonaws.com" + exoscaleDomain = ".exo.io" + doDomain = ".k8s.ondigitalocean.com" + lkeDomain = ".linodelke.net" + scalewayDomain = ".scw.cloud" + vultrDomain = ".vultr-k8s.com" +) + +func APIServerCertificate(cfg *rest.Config) (*x509.Certificate, error) { + err := rest.LoadTLSFiles(cfg) + if err != nil { + return nil, err + } + + // create ca cert pool + caCertPool := x509.NewCertPool() + ok := caCertPool.AppendCertsFromPEM(cfg.CAData) + if !ok { + return nil, fmt.Errorf("can't append caCert to caCertPool") + } + + tr := &http.Transport{ + Proxy: http.ProxyFromEnvironment, + DialContext: (&net.Dialer{ + Timeout: 30 * time.Second, + KeepAlive: 30 * time.Second, + }).DialContext, + MaxIdleConns: 100, + IdleConnTimeout: 90 * time.Second, + TLSHandshakeTimeout: 10 * time.Second, + ExpectContinueTimeout: 1 * time.Second, + TLSClientConfig: &tls.Config{RootCAs: caCertPool}, + } + client := &http.Client{Transport: tr} + + resp, err := client.Get(cfg.Host) + if err != nil { + return nil, err + } + for i := range resp.TLS.VerifiedChains { + return resp.TLS.VerifiedChains[i][0], nil + } + return nil, fmt.Errorf("no cert found") +} + +func DetectProvider(cfg *rest.Config, mapper meta.RESTMapper) (kmapi.HostingProvider, error) { + crt, err := APIServerCertificate(cfg) + if err != nil { + return "", err + } + + for _, host := range crt.DNSNames { + if strings.HasSuffix(host, eksDomain) { + return kmapi.HostingProviderAWS, nil + } else if strings.HasSuffix(host, aksDomain) { + return kmapi.HostingProviderAzure, nil + } else if strings.HasSuffix(host, doDomain) { + return kmapi.HostingProviderDigitalOcean, nil + } else if strings.HasSuffix(host, exoscaleDomain) { + return kmapi.HostingProviderExoscale, nil + } else if strings.HasSuffix(host, lkeDomain) { + return kmapi.HostingProviderLinode, nil + } else if strings.HasSuffix(host, scalewayDomain) { + return kmapi.HostingProviderScaleway, nil + } else if strings.HasSuffix(host, vultrDomain) { + return kmapi.HostingProviderVultr, nil + } + } + + // GKE does not use any custom domain + if _, err := mapper.RESTMappings(schema.GroupKind{ + Group: "networking.gke.io", + Kind: "Network", + }); err == nil { + return kmapi.HostingProviderGoogleCloud, nil + } + + return "", nil +} diff --git a/vendor/kmodules.xyz/client-go/meta/cloud.go b/vendor/kmodules.xyz/client-go/cluster/host_detector.go similarity index 97% rename from vendor/kmodules.xyz/client-go/meta/cloud.go rename to vendor/kmodules.xyz/client-go/cluster/host_detector.go index a7eb6556..f10bbbd9 100644 --- a/vendor/kmodules.xyz/client-go/meta/cloud.go +++ b/vendor/kmodules.xyz/client-go/cluster/host_detector.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package meta +package cluster import ( "crypto/x509" @@ -67,8 +67,6 @@ func TestGKE() (string, error) { return v.(string), nil } -const aksDomain = ".azmk8s.io" - func TestAKS(cert *x509.Certificate) (string, error) { for _, host := range cert.DNSNames { if strings.HasSuffix(host, aksDomain) && isAKS() == nil { @@ -98,8 +96,6 @@ func isAKS() error { return nil } -const eksDomain = ".eks.amazonaws.com" - func TestEKS(cert *x509.Certificate) (string, error) { for _, host := range cert.DNSNames { if strings.HasSuffix(host, eksDomain) && isEKS() == nil { diff --git a/vendor/kmodules.xyz/client-go/core/v1/kubernetes.go b/vendor/kmodules.xyz/client-go/core/v1/kubernetes.go index d53222dd..1b7ed9e4 100644 --- a/vendor/kmodules.xyz/client-go/core/v1/kubernetes.go +++ b/vendor/kmodules.xyz/client-go/core/v1/kubernetes.go @@ -79,6 +79,15 @@ func GetContainerByName(containers []core.Container, name string) *core.Containe return nil } +func GetContainerIdByName(containers []core.Container, name string) int { + for i := range containers { + if containers[i].Name == name { + return i + } + } + return -1 +} + func UpsertContainer(containers []core.Container, upsert core.Container) []core.Container { for i, container := range containers { if container.Name == upsert.Name { diff --git a/vendor/kmodules.xyz/client-go/core/v1/node.go b/vendor/kmodules.xyz/client-go/core/v1/node.go index 7282a20d..92642e5b 100644 --- a/vendor/kmodules.xyz/client-go/core/v1/node.go +++ b/vendor/kmodules.xyz/client-go/core/v1/node.go @@ -134,18 +134,6 @@ type Topology struct { LabelZone string LabelRegion string LabelInstanceType string - - // https://github.com/kubernetes/kubernetes/blob/v1.17.2/staging/src/k8s.io/api/core/v1/well_known_labels.go - - //LabelHostname = "kubernetes.io/hostname" - // - //LabelZoneFailureDomain = "failure-domain.beta.kubernetes.io/zone" - //LabelZoneRegion = "failure-domain.beta.kubernetes.io/region" - //LabelZoneFailureDomainStable = "topology.kubernetes.io/zone" - //LabelZoneRegionStable = "topology.kubernetes.io/region" - // - //LabelInstanceType = "beta.kubernetes.io/instance-type" - //LabelInstanceTypeStable = "node.kubernetes.io/instance-type" } func (t Topology) ConvertAffinity(affinity *core.Affinity) { @@ -226,16 +214,16 @@ func DetectTopology(ctx context.Context, mc metadata.Interface) (*Topology, erro labels := m.GetLabels() if first { - if _, ok := labels[core.LabelZoneRegionStable]; ok { - topology.LabelRegion = core.LabelZoneRegionStable + if _, ok := labels[core.LabelTopologyRegion]; ok { + topology.LabelRegion = core.LabelTopologyRegion } else { - topology.LabelRegion = core.LabelZoneRegion + topology.LabelRegion = core.LabelFailureDomainBetaRegion } - if _, ok := labels[core.LabelZoneFailureDomainStable]; ok { - topology.LabelZone = core.LabelZoneFailureDomainStable + if _, ok := labels[core.LabelTopologyZone]; ok { + topology.LabelZone = core.LabelTopologyZone } else { - topology.LabelZone = core.LabelZoneFailureDomain + topology.LabelZone = core.LabelFailureDomainBetaZone } if _, ok := labels[core.LabelInstanceTypeStable]; ok { @@ -251,17 +239,15 @@ func DetectTopology(ctx context.Context, mc metadata.Interface) (*Topology, erro if os != "linux" { return nil } - arch, _ := meta_util.GetStringValueForKeys(labels, core.LabelArchStable, "beta.kubernetes.io/arch") - if arch != "amd64" { - return nil - } - region, _ := meta_util.GetStringValueForKeys(labels, topology.LabelRegion) - zone, _ := meta_util.GetStringValueForKeys(labels, topology.LabelZone) - if _, ok := mapRegion[region]; !ok { - mapRegion[region] = sets.Set[string]{} + if region, ok := labels[topology.LabelRegion]; ok { + if _, ok := mapRegion[region]; !ok { + mapRegion[region] = sets.Set[string]{} + } + if zone, ok := labels[topology.LabelZone]; ok { + mapRegion[region].Insert(zone) + } } - mapRegion[region].Insert(zone) instance, _ := meta_util.GetStringValueForKeys(labels, topology.LabelInstanceType) if n, ok := instances[instance]; ok { diff --git a/vendor/kmodules.xyz/client-go/meta/incluster.go b/vendor/kmodules.xyz/client-go/meta/incluster.go index 86ece8d3..9f5e321c 100644 --- a/vendor/kmodules.xyz/client-go/meta/incluster.go +++ b/vendor/kmodules.xyz/client-go/meta/incluster.go @@ -17,17 +17,11 @@ limitations under the License. package meta import ( - "crypto/tls" - "crypto/x509" - "fmt" "net" - "net/http" "os" "strings" - "time" core "k8s.io/api/core/v1" - "k8s.io/client-go/rest" ) // xref: https://kubernetes.io/docs/concepts/workloads/pods/downward-api/ @@ -71,44 +65,6 @@ func PossiblyInCluster() bool { err == nil && !fi.IsDir() } -func APIServerCertificate(cfg *rest.Config) (*x509.Certificate, error) { - err := rest.LoadTLSFiles(cfg) - if err != nil { - return nil, err - } - - // create ca cert pool - caCertPool := x509.NewCertPool() - ok := caCertPool.AppendCertsFromPEM(cfg.CAData) - if !ok { - return nil, fmt.Errorf("can't append caCert to caCertPool") - } - - tr := &http.Transport{ - Proxy: http.ProxyFromEnvironment, - DialContext: (&net.Dialer{ - Timeout: 30 * time.Second, - KeepAlive: 30 * time.Second, - DualStack: true, - }).DialContext, - MaxIdleConns: 100, - IdleConnTimeout: 90 * time.Second, - TLSHandshakeTimeout: 10 * time.Second, - ExpectContinueTimeout: 1 * time.Second, - TLSClientConfig: &tls.Config{RootCAs: caCertPool}, - } - client := &http.Client{Transport: tr} - - resp, err := client.Get(cfg.Host) - if err != nil { - return nil, err - } - for i := range resp.TLS.VerifiedChains { - return resp.TLS.VerifiedChains[i][0], nil - } - return nil, fmt.Errorf("no cert found") -} - func ClusterDomain() string { defaultDomain := func() string { if v, ok := os.LookupEnv("KUBE_CLUSTER_DOMAIN"); ok { diff --git a/vendor/kmodules.xyz/resource-metadata/apis/identity/v1alpha1/openapi_generated.go b/vendor/kmodules.xyz/resource-metadata/apis/identity/v1alpha1/openapi_generated.go index e58844a4..ad48a449 100644 --- a/vendor/kmodules.xyz/resource-metadata/apis/identity/v1alpha1/openapi_generated.go +++ b/vendor/kmodules.xyz/resource-metadata/apis/identity/v1alpha1/openapi_generated.go @@ -340,6 +340,7 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "kmodules.xyz/resource-metadata/apis/identity/v1alpha1.InboxTokenRequestRequest": schema_resource_metadata_apis_identity_v1alpha1_InboxTokenRequestRequest(ref), "kmodules.xyz/resource-metadata/apis/identity/v1alpha1.InboxTokenRequestResponse": schema_resource_metadata_apis_identity_v1alpha1_InboxTokenRequestResponse(ref), "kmodules.xyz/resource-metadata/apis/identity/v1alpha1.KubernetesInfo": schema_resource_metadata_apis_identity_v1alpha1_KubernetesInfo(ref), + "kmodules.xyz/resource-metadata/apis/identity/v1alpha1.NodeInfo": schema_resource_metadata_apis_identity_v1alpha1_NodeInfo(ref), "kmodules.xyz/resource-metadata/apis/identity/v1alpha1.NodeStats": schema_resource_metadata_apis_identity_v1alpha1_NodeStats(ref), "kmodules.xyz/resource-metadata/apis/identity/v1alpha1.ProductInfo": schema_resource_metadata_apis_identity_v1alpha1_ProductInfo(ref), "kmodules.xyz/resource-metadata/apis/identity/v1alpha1.SelfSubjectNamespaceAccessReview": schema_resource_metadata_apis_identity_v1alpha1_SelfSubjectNamespaceAccessReview(ref), @@ -17249,7 +17250,7 @@ func schema_resource_metadata_apis_identity_v1alpha1_KubernetesInfo(ref common.R "nodeStats": { SchemaProps: spec.SchemaProps{ Default: map[string]interface{}{}, - Ref: ref("kmodules.xyz/resource-metadata/apis/identity/v1alpha1.NodeStats"), + Ref: ref("kmodules.xyz/resource-metadata/apis/identity/v1alpha1.NodeInfo"), }, }, }, @@ -17257,7 +17258,65 @@ func schema_resource_metadata_apis_identity_v1alpha1_KubernetesInfo(ref common.R }, }, Dependencies: []string{ - "k8s.io/apimachinery/pkg/version.Info", "kmodules.xyz/client-go/api/v1.ClusterMetadata", "kmodules.xyz/resource-metadata/apis/identity/v1alpha1.ControlPlaneInfo", "kmodules.xyz/resource-metadata/apis/identity/v1alpha1.NodeStats"}, + "k8s.io/apimachinery/pkg/version.Info", "kmodules.xyz/client-go/api/v1.ClusterMetadata", "kmodules.xyz/resource-metadata/apis/identity/v1alpha1.ControlPlaneInfo", "kmodules.xyz/resource-metadata/apis/identity/v1alpha1.NodeInfo"}, + } +} + +func schema_resource_metadata_apis_identity_v1alpha1_NodeInfo(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "count": { + SchemaProps: spec.SchemaProps{ + Type: []string{"integer"}, + Format: "int32", + }, + }, + "capacity": { + SchemaProps: spec.SchemaProps{ + Description: "Capacity represents the total resources of a node. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#capacity", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), + }, + }, + }, + }, + }, + "allocatable": { + SchemaProps: spec.SchemaProps{ + Description: "Allocatable represents the resources of a node that are available for scheduling. Defaults to Capacity.", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), + }, + }, + }, + }, + }, + "controlPlane": { + SchemaProps: spec.SchemaProps{ + Ref: ref("kmodules.xyz/resource-metadata/apis/identity/v1alpha1.NodeStats"), + }, + }, + "workers": { + SchemaProps: spec.SchemaProps{ + Ref: ref("kmodules.xyz/resource-metadata/apis/identity/v1alpha1.NodeStats"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/api/resource.Quantity", "kmodules.xyz/resource-metadata/apis/identity/v1alpha1.NodeStats"}, } } diff --git a/vendor/kmodules.xyz/resource-metadata/apis/identity/v1alpha1/siteinfo_types.go b/vendor/kmodules.xyz/resource-metadata/apis/identity/v1alpha1/siteinfo_types.go index 8c0e0594..20da75a8 100644 --- a/vendor/kmodules.xyz/resource-metadata/apis/identity/v1alpha1/siteinfo_types.go +++ b/vendor/kmodules.xyz/resource-metadata/apis/identity/v1alpha1/siteinfo_types.go @@ -76,7 +76,7 @@ type KubernetesInfo struct { Cluster *kmapi.ClusterMetadata `json:"cluster,omitempty"` Version *version.Info `json:"version,omitempty"` ControlPlane *ControlPlaneInfo `json:"controlPlane,omitempty"` - NodeStats NodeStats `json:"nodeStats"` + NodeStats NodeInfo `json:"nodeStats"` } // https://github.com/kmodules/client-go/blob/kubernetes-1.16.3/tools/analytics/analytics.go#L66 @@ -89,6 +89,12 @@ type ControlPlaneInfo struct { NotAfter metav1.Time `json:"notAfter"` } +type NodeInfo struct { + NodeStats `json:",inline"` + ControlPlane *NodeStats `json:"controlPlane,omitempty"` + Workers *NodeStats `json:"workers,omitempty"` +} + type NodeStats struct { Count int `json:"count,omitempty"` diff --git a/vendor/kmodules.xyz/resource-metadata/apis/identity/v1alpha1/zz_generated.deepcopy.go b/vendor/kmodules.xyz/resource-metadata/apis/identity/v1alpha1/zz_generated.deepcopy.go index b7e34b44..c6279cce 100644 --- a/vendor/kmodules.xyz/resource-metadata/apis/identity/v1alpha1/zz_generated.deepcopy.go +++ b/vendor/kmodules.xyz/resource-metadata/apis/identity/v1alpha1/zz_generated.deepcopy.go @@ -227,6 +227,33 @@ func (in *KubernetesInfo) DeepCopy() *KubernetesInfo { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NodeInfo) DeepCopyInto(out *NodeInfo) { + *out = *in + in.NodeStats.DeepCopyInto(&out.NodeStats) + if in.ControlPlane != nil { + in, out := &in.ControlPlane, &out.ControlPlane + *out = new(NodeStats) + (*in).DeepCopyInto(*out) + } + if in.Workers != nil { + in, out := &in.Workers, &out.Workers + *out = new(NodeStats) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeInfo. +func (in *NodeInfo) DeepCopy() *NodeInfo { + if in == nil { + return nil + } + out := new(NodeInfo) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *NodeStats) DeepCopyInto(out *NodeStats) { *out = *in diff --git a/vendor/kmodules.xyz/resource-metadata/pkg/identity/siteinfo.go b/vendor/kmodules.xyz/resource-metadata/pkg/identity/siteinfo.go index 8211119f..e0f8f131 100644 --- a/vendor/kmodules.xyz/resource-metadata/pkg/identity/siteinfo.go +++ b/vendor/kmodules.xyz/resource-metadata/pkg/identity/siteinfo.go @@ -21,9 +21,9 @@ import ( "net" "strings" - meta_util "kmodules.xyz/client-go/meta" + clustermeta "kmodules.xyz/client-go/cluster" "kmodules.xyz/client-go/tools/clusterid" - auditorapi "kmodules.xyz/resource-metadata/apis/identity/v1alpha1" + identityapi "kmodules.xyz/resource-metadata/apis/identity/v1alpha1" "kmodules.xyz/resource-metrics/api" "go.bytebuilders.dev/license-verifier/info" @@ -35,26 +35,26 @@ import ( "k8s.io/client-go/rest" ) -func GetSiteInfo(cfg *rest.Config, kc kubernetes.Interface, nodes []*core.Node, licenseID string) (*auditorapi.SiteInfo, error) { - si := auditorapi.SiteInfo{ +func GetSiteInfo(cfg *rest.Config, kc kubernetes.Interface, nodes []*core.Node, licenseID string) (*identityapi.SiteInfo, error) { + si := identityapi.SiteInfo{ TypeMeta: metav1.TypeMeta{ - APIVersion: auditorapi.SchemeGroupVersion.String(), + APIVersion: identityapi.SchemeGroupVersion.String(), Kind: "SiteInfo", }, ObjectMeta: metav1.ObjectMeta{ Name: SelfName, }, - Kubernetes: &auditorapi.KubernetesInfo{}, + Kubernetes: &identityapi.KubernetesInfo{}, } if info.ProductName != "" || v.Version.Version != "" || licenseID != "" { - si.Product = &auditorapi.ProductInfo{} + si.Product = &identityapi.ProductInfo{} si.Product.LicenseID = licenseID si.Product.ProductOwnerName = info.ProductOwnerName si.Product.ProductOwnerUID = info.ProductOwnerUID si.Product.ProductName = info.ProductName si.Product.ProductUID = info.ProductUID - si.Product.Version = auditorapi.Version{ + si.Product.Version = identityapi.Version{ Version: v.Version.Version, VersionStrategy: v.Version.VersionStrategy, CommitHash: v.Version.CommitHash, @@ -77,11 +77,11 @@ func GetSiteInfo(cfg *rest.Config, kc kubernetes.Interface, nodes []*core.Node, return nil, err } - cert, err := meta_util.APIServerCertificate(cfg) + cert, err := clustermeta.APIServerCertificate(cfg) if err != nil { return nil, err } else { - si.Kubernetes.ControlPlane = &auditorapi.ControlPlaneInfo{ + si.Kubernetes.ControlPlane = &identityapi.ControlPlaneInfo{ NotBefore: metav1.NewTime(cert.NotBefore), NotAfter: metav1.NewTime(cert.NotAfter), // DNSNames: cert.DNSNames, @@ -143,20 +143,41 @@ func GetSiteInfo(cfg *rest.Config, kc kubernetes.Interface, nodes []*core.Node, return &si, nil } -func RefreshNodeStats(si *auditorapi.SiteInfo, nodes []*core.Node) { +func RefreshNodeStats(si *identityapi.SiteInfo, nodes []*core.Node) { if len(nodes) == 0 { return } - si.Kubernetes.NodeStats.Count = len(nodes) - var capacity core.ResourceList - var allocatable core.ResourceList + var total, cp, w identityapi.NodeStats for _, node := range nodes { - capacity = api.AddResourceList(capacity, node.Status.Capacity) - allocatable = api.AddResourceList(allocatable, node.Status.Allocatable) + total.Count++ + total.Capacity = api.AddResourceList(total.Capacity, node.Status.Capacity) + total.Allocatable = api.AddResourceList(total.Allocatable, node.Status.Allocatable) + + if isControlPlaneNode(node) { + cp.Count++ + cp.Capacity = api.AddResourceList(cp.Capacity, node.Status.Capacity) + cp.Allocatable = api.AddResourceList(cp.Allocatable, node.Status.Allocatable) + } else { + w.Count++ + w.Capacity = api.AddResourceList(w.Capacity, node.Status.Capacity) + w.Allocatable = api.AddResourceList(w.Allocatable, node.Status.Allocatable) + } + } + + si.Kubernetes.NodeStats.NodeStats = total + if cp.Count > 0 { + si.Kubernetes.NodeStats.ControlPlane = &cp } - si.Kubernetes.NodeStats.Capacity = capacity - si.Kubernetes.NodeStats.Allocatable = allocatable + if w.Count > 0 { + si.Kubernetes.NodeStats.Workers = &w + } +} + +func isControlPlaneNode(node *core.Node) bool { + _, okCP := node.Labels["node-role.kubernetes.io/control-plane"] + _, okMaster := node.Labels["node-role.kubernetes.io/master"] + return okCP || okMaster } func skipIP(ip net.IP) bool { diff --git a/vendor/modules.txt b/vendor/modules.txt index 229d4a43..f1052ed6 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -213,7 +213,7 @@ github.com/modern-go/reflect2 # github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 ## explicit github.com/munnerz/goautoneg -# github.com/nats-io/nats.go v1.35.0 +# github.com/nats-io/nats.go v1.36.0 ## explicit; go 1.20 github.com/nats-io/nats.go github.com/nats-io/nats.go/encoders/builtin @@ -285,7 +285,7 @@ github.com/yudai/golcs # github.com/zeebo/xxh3 v1.0.2 ## explicit; go 1.17 github.com/zeebo/xxh3 -# go.bytebuilders.dev/license-proxyserver v0.0.8 +# go.bytebuilders.dev/license-proxyserver v0.0.11 ## explicit; go 1.22.0 go.bytebuilders.dev/license-proxyserver/apis/proxyserver go.bytebuilders.dev/license-proxyserver/apis/proxyserver/v1alpha1 @@ -443,7 +443,7 @@ gopkg.in/yaml.v2 # gopkg.in/yaml.v3 v3.0.1 ## explicit gopkg.in/yaml.v3 -# k8s.io/api v0.30.1 +# k8s.io/api v0.30.2 ## explicit; go 1.22.0 k8s.io/api/admission/v1 k8s.io/api/admission/v1beta1 @@ -512,7 +512,7 @@ k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/scheme k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1 k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1beta1 -# k8s.io/apimachinery v0.30.1 +# k8s.io/apimachinery v0.30.2 ## explicit; go 1.22.0 k8s.io/apimachinery/pkg/api/equality k8s.io/apimachinery/pkg/api/errors @@ -568,7 +568,7 @@ k8s.io/apimachinery/third_party/forked/golang/reflect # k8s.io/apiserver v0.30.1 ## explicit; go 1.22.0 k8s.io/apiserver/pkg/server/mux -# k8s.io/client-go v0.30.1 +# k8s.io/client-go v0.30.2 ## explicit; go 1.22.0 k8s.io/client-go/applyconfigurations/admissionregistration/v1 k8s.io/client-go/applyconfigurations/admissionregistration/v1alpha1 @@ -828,7 +828,7 @@ k8s.io/client-go/util/flowcontrol k8s.io/client-go/util/homedir k8s.io/client-go/util/keyutil k8s.io/client-go/util/workqueue -# k8s.io/klog/v2 v2.120.1 +# k8s.io/klog/v2 v2.130.1 ## explicit; go 1.18 k8s.io/klog/v2 k8s.io/klog/v2/internal/buffer @@ -846,7 +846,7 @@ k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/typed/apiregistration/v1 k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/typed/apiregistration/v1beta1 -# k8s.io/kube-openapi v0.0.0-20240521193020-835d969ad83a +# k8s.io/kube-openapi v0.0.0-20240430033511-f0e62f92d13f ## explicit; go 1.20 k8s.io/kube-openapi/pkg/cached k8s.io/kube-openapi/pkg/common @@ -871,7 +871,7 @@ k8s.io/utils/trace # kmodules.xyz/apiversion v0.2.0 ## explicit; go 1.14 kmodules.xyz/apiversion -# kmodules.xyz/client-go v0.30.5 +# kmodules.xyz/client-go v0.30.9 ## explicit; go 1.22.0 kmodules.xyz/client-go kmodules.xyz/client-go/api/v1 @@ -892,7 +892,7 @@ kmodules.xyz/go-containerregistry/name ## explicit; go 1.22.0 kmodules.xyz/offshoot-api/api/v1 kmodules.xyz/offshoot-api/api/v2 -# kmodules.xyz/resource-metadata v0.18.8-0.20240614001230-063fb3a89196 +# kmodules.xyz/resource-metadata v0.18.10 ## explicit; go 1.22.1 kmodules.xyz/resource-metadata/apis/core/v1alpha1 kmodules.xyz/resource-metadata/apis/identity/v1alpha1