From bdb82a6bd1075ae1721c3d0dd2211ffecf433a86 Mon Sep 17 00:00:00 2001 From: gaoyuan Date: Sun, 29 Sep 2024 19:46:53 +0800 Subject: [PATCH 1/5] update syncpodstatus from leaf to root with RetryOnConflict Signed-off-by: gaoyuan --- go.sum | 89 +++++++++++++++++++ .../controllers/node_lease_controller.go | 65 +++++++++++++- .../controllers/pod/leaf_pod_controller.go | 48 +++++----- 3 files changed, 179 insertions(+), 23 deletions(-) diff --git a/go.sum b/go.sum index e94cc6393..40b53ae98 100644 --- a/go.sum +++ b/go.sum @@ -390,6 +390,7 @@ cloud.google.com/go/workflows v1.7.0/go.mod h1:JhSrZuVZWuiDfKEFxU0/F1PQjmpnpcoIS cloud.google.com/go/workflows v1.8.0/go.mod h1:ysGhmEajwZxGn1OhGOGKsTXc5PyxOc0vfKf5Af+to4M= cloud.google.com/go/workflows v1.9.0/go.mod h1:ZGkj1aFIOd9c8Gerkjjq7OW7I5+l6cSvT3ujaO/WwSA= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= +github.com/AdaLogics/go-fuzz-headers v0.0.0-20210715213245-6c3934b029d8/go.mod h1:CzsSbkDixRphAF5hS6wbMKq0eI6ccJRb7/A0M6JBnwg= github.com/Azure/azure-sdk-for-go v16.2.1+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= github.com/Azure/azure-sdk-for-go v55.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= @@ -447,20 +448,26 @@ github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAE github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/Shopify/logrus-bugsnag v0.0.0-20171204204709-577dee27f20d/go.mod h1:HI8ITrYtUY+O+ZhtlqUnD8+KwNPOyugEhfP9fdUIaEQ= +github.com/StackExchange/wmi v0.0.0-20181212234831-e0a55b97c705/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= +github.com/Workiva/go-datastructures v1.0.53/go.mod h1:1yZL+zfsztete+ePzZz/Zb1/t5BnDuE2Ya2MMGhzP6A= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= github.com/alessio/shellescape v1.2.2/go.mod h1:PZAiSCk0LJaZkiCSkPv8qIobYglO3FPpyFjDCtHLS30= +github.com/alessio/shellescape v1.4.1/go.mod h1:PZAiSCk0LJaZkiCSkPv8qIobYglO3FPpyFjDCtHLS30= github.com/alexflint/go-filemutex v0.0.0-20171022225611-72bdc8eae2ae/go.mod h1:CgnQgUtFrFz9mxFNtED3jI5tLDjKlOM+oUF/sTk6ps0= +github.com/alexflint/go-filemutex v1.1.0/go.mod h1:7P4iRhttt/nUvUOrYIhcpMzv2G6CY9UnI16Z+UJqRyk= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/antlr/antlr4/runtime/Go/antlr v0.0.0-20220418222510-f25a4f6275ed/go.mod h1:F7bn7fEU90QkQ3tnmaTx3LTKLEDqnwWODIYppRQ5hnY= github.com/antlr/antlr4/runtime/Go/antlr v1.4.10 h1:yL7+Jz0jTC6yykIK/Wh74gnTJnrGr5AyrNMXuA0gves= github.com/antlr/antlr4/runtime/Go/antlr v1.4.10/go.mod h1:F7bn7fEU90QkQ3tnmaTx3LTKLEDqnwWODIYppRQ5hnY= +github.com/apparentlymart/go-cidr v1.1.0/go.mod h1:EBcsNrHc3zQeuaeCeCtQruQm+n9/YjEn/vI25Lg7Gwc= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= +github.com/armon/go-metrics v0.3.10/go.mod h1:4O98XIr/9W0sxpJ8UaYkvjk10Iff7SnFrb4QAOwNTFc= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= @@ -468,6 +475,18 @@ github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:l github.com/aws/aws-sdk-go v1.15.11/go.mod h1:mFuSZ37Z9YOHbQEwBWztmVzqXrEkub65tZoCYDt7FT0= github.com/aws/aws-sdk-go v1.35.24/go.mod h1:tlPOdRjfxPBpNIwqDj61rmsnA85v9jc0Ps9+muhnW+k= github.com/aws/aws-sdk-go v1.44.116/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo= +github.com/aws/aws-sdk-go-v2 v1.11.0/go.mod h1:SQfA+m2ltnu1cA0soUkj4dRSsmITiVQUJvBIZjzfPyQ= +github.com/aws/aws-sdk-go-v2/config v1.10.0/go.mod h1:xuqoV5etD3N3B8Ts9je4ijgAv6mb+6NiOPFMUhwRcjA= +github.com/aws/aws-sdk-go-v2/credentials v1.6.0/go.mod h1:rQkYdQPDXRrvPLeEuCNwSgtwMzBo9eDGWlTNC69Sh/0= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.8.0/go.mod h1:5E1J3/TTYy6z909QNR0QnXGBpfESYGDqd3O0zqONghU= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.0/go.mod h1:NO3Q5ZTTQtO2xIg2+xTXYDiT7knSejfeDm7WGDaOo0U= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.0.0/go.mod h1:anlUzBoEWglcUxUQwZA7HQOEVEnQALVZsizAapB2hq8= +github.com/aws/aws-sdk-go-v2/internal/ini v1.3.0/go.mod h1:6oXGy4GLpypD3uCh8wcqztigGgmhLToMfjavgh+VySg= +github.com/aws/aws-sdk-go-v2/service/ec2 v1.21.0/go.mod h1:kK7lSKNwAqIMKVCTsfVcN82m8pvuPUf+6g/zrz/PnE0= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.5.0/go.mod h1:Mq6AEc+oEjCUlBuLiK5YwW4shSOAKCQ3tXN0sQeYoBA= +github.com/aws/aws-sdk-go-v2/service/sso v1.6.0/go.mod h1:Q/l0ON1annSU+mc0JybDy1Gy6dnJxIcWjphO6qJPzvM= +github.com/aws/aws-sdk-go-v2/service/sts v1.9.0/go.mod h1:jLKCFqS+1T4i7HDqCP9GM4Uk75YW1cS0o82LdxpMyOE= +github.com/aws/smithy-go v1.9.0/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E= github.com/bazelbuild/rules_go v0.38.1/go.mod h1:TMHmtfpvyfsxaqfL9WnahCsXMWDMICTw7XeK9yVb+YU= github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= @@ -489,6 +508,7 @@ github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2y github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4= github.com/bshuster-repo/logrus-logstash-hook v0.4.1/go.mod h1:zsTqEiSzDgAa/8GZR7E1qaXrhYNDKBYy5/dWPTIflbk= github.com/buger/jsonparser v0.0.0-20180808090653-f4dd9f5a6b44/go.mod h1:bbYlZJ7hK1yFx9hf58LP0zeX7UjIGs20ufpu3evjr+s= +github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0= github.com/bugsnag/bugsnag-go v0.0.0-20141110184014-b1d153021fcd/go.mod h1:2oa8nejYd4cQ/b0hMIopN0lCRxU0bueqREvZLWFrtK8= github.com/bugsnag/osext v0.0.0-20130617224835-0dd3f918b21b/go.mod h1:obH5gd0BsqsP2LwDJ9aOkm/6J86V6lyAXCoQWGw3K50= github.com/bugsnag/panicwrap v0.0.0-20151223152923-e2c28503fcd0/go.mod h1:D/8v3kj0zr8ZAKg1AQ6crr+5VwKN5eIywRkfhyM/+dE= @@ -522,6 +542,7 @@ github.com/cilium/ebpf v0.6.2/go.mod h1:4tRaxcgiL706VnOzHOdBlY8IEAIdxINsQBcU4xJJ github.com/cilium/ebpf v0.7.0/go.mod h1:/oI2+1shJiTGAMgl6/RgJr36Eo1jzrRcAWbcXO2usCA= github.com/cilium/ebpf v0.9.3/go.mod h1:w27N4UjpaQ9X/DGrSugxUG+H+NhgntDuPb5lCzxCn8A= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/clusterhq/flocker-go v0.0.0-20160920122132-2b8b7259d313/go.mod h1:P1wt9Z3DP8O6W3rvwCt0REIlshg1InHImaLW0t3ObY0= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= @@ -597,6 +618,7 @@ github.com/containerd/fifo v1.0.0 h1:6PirWBr9/L7GDamKr+XM0IeUFXu5mf3M/BPpH9gaLBU github.com/containerd/fifo v1.0.0/go.mod h1:ocF/ME1SX5b1AOlWi9r677YJmCPSwwWnQ9O123vzpE4= github.com/containerd/go-cni v1.0.1/go.mod h1:+vUpYxKvAF72G9i1WoDOiPGRtQpqsNW/ZHtSlv++smU= github.com/containerd/go-cni v1.0.2/go.mod h1:nrNABBHzu0ZwCug9Ije8hL2xBCYh/pjfMb1aZGrrohk= +github.com/containerd/go-cni v1.1.6/go.mod h1:BWtoWl5ghVymxu6MBjg79W9NZrCRyHIdUtk4cauMe34= github.com/containerd/go-runc v0.0.0-20180907222934-5a6d9f37cfa3/go.mod h1:IV7qH3hrUgRmyYrtgEeGWJfWbgcHL9CSRruz2Vqcph0= github.com/containerd/go-runc v0.0.0-20190911050354-e029b79d8cda/go.mod h1:IV7qH3hrUgRmyYrtgEeGWJfWbgcHL9CSRruz2Vqcph0= github.com/containerd/go-runc v0.0.0-20200220073739-7016d3ce2328/go.mod h1:PpyHrqVs8FTi9vpyHwPwiNEGaACDxT/N/pLcvMSRA9g= @@ -606,6 +628,7 @@ github.com/containerd/imgcrypt v1.0.1/go.mod h1:mdd8cEPW7TPgNG4FpuP3sGBiQ7Yi/zak github.com/containerd/imgcrypt v1.0.4-0.20210301171431-0ae5c75f59ba/go.mod h1:6TNsg0ctmizkrOgXRNQjAPFWpMYRWuiB6dSF4Pfa5SA= github.com/containerd/imgcrypt v1.1.1-0.20210312161619-7ed62a527887/go.mod h1:5AZJNI6sLHJljKuI9IHnw1pWqo/F0nGDOuR9zgTs7ow= github.com/containerd/imgcrypt v1.1.1/go.mod h1:xpLnwiQmEUJPvQoAapeb2SNCxz7Xr6PJrXQb0Dpc4ms= +github.com/containerd/imgcrypt v1.1.4/go.mod h1:LorQnPtzL/T0IyCeftcsMEO7AqxUDbdO8j/tSUpgxvo= github.com/containerd/nri v0.0.0-20201007170849-eb1350a75164/go.mod h1:+2wGSDGFYfE5+So4M5syatU0N0f0LbWpuqyMi4/BE8c= github.com/containerd/nri v0.0.0-20210316161719-dbaa18c31c14/go.mod h1:lmxnXF6oMkbqs39FiCt1s0R2HSMhcLel9vNL3m4AaeY= github.com/containerd/nri v0.1.0/go.mod h1:lmxnXF6oMkbqs39FiCt1s0R2HSMhcLel9vNL3m4AaeY= @@ -630,11 +653,14 @@ github.com/containerd/zfs v1.0.0/go.mod h1:m+m51S1DvAP6r3FcmYCp54bQ34pyOwTieQDNR github.com/containernetworking/cni v0.7.1/go.mod h1:LGwApLUm2FpoOfxTDEeq8T9ipbpZ61X79hmU3w8FmsY= github.com/containernetworking/cni v0.8.0/go.mod h1:LGwApLUm2FpoOfxTDEeq8T9ipbpZ61X79hmU3w8FmsY= github.com/containernetworking/cni v0.8.1/go.mod h1:LGwApLUm2FpoOfxTDEeq8T9ipbpZ61X79hmU3w8FmsY= +github.com/containernetworking/cni v1.1.1/go.mod h1:sDpYKmGVENF3s6uvMvGgldDWeG8dMxakj/u+i9ht9vw= github.com/containernetworking/plugins v0.8.6/go.mod h1:qnw5mN19D8fIwkqW7oHHYDHVlzhJpcY6TQxn/fUyDDM= github.com/containernetworking/plugins v0.9.1/go.mod h1:xP/idU2ldlzN6m4p5LmGiwRDjeJr6FLK6vuiUwoH7P8= +github.com/containernetworking/plugins v1.1.1/go.mod h1:Sr5TH/eBsGLXK/h71HeLfX19sZPp3ry5uHSkI4LPxV8= github.com/containers/ocicrypt v1.0.1/go.mod h1:MeJDzk1RJHv89LjsH0Sp5KTY3ZYkjXO/C+bKAeWFIrc= github.com/containers/ocicrypt v1.1.0/go.mod h1:b8AOe0YR67uU8OqfVNcznfFpAzu3rdgUV4GP9qXPfu4= github.com/containers/ocicrypt v1.1.1/go.mod h1:Dm55fwWm1YZAjYRaJ94z2mfZikIyIN4B0oB3dj3jFxY= +github.com/containers/ocicrypt v1.1.3/go.mod h1:xpdkbVAuaH3WzbEabUd5yDsl9SwJA5pABH85425Es2g= github.com/coredns/caddy v1.1.0/go.mod h1:A6ntJQlAWuQfFlsd9hvigKbo2WS0VUs2l1e2F+BawD4= github.com/coredns/corefile-migration v1.0.17/go.mod h1:XnhgULOEouimnzgn0t4WPuFDN2/PJQcTxdWKC5eXNGE= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= @@ -681,6 +707,7 @@ github.com/denverdino/aliyungo v0.0.0-20190125010748-a747050bb1ba/go.mod h1:dV8l github.com/dgrijalva/jwt-go v0.0.0-20170104182250-a601269ab70c/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= +github.com/distribution/distribution v2.8.1+incompatible/go.mod h1:EgLm2NgWtdKgzF9NpMzUKgzmR7AMmb0VQi2B+ZzDRjc= github.com/dnaeon/go-vcr v1.0.1/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyGc8n1E= github.com/dnaeon/go-vcr v1.2.0/go.mod h1:R4UdLID7HZT3taECzJs4YgbbH6PIGXB6W/sc5OLb6RQ= github.com/docker/cli v0.0.0-20191017083524-a8ff7f821017/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= @@ -713,6 +740,7 @@ github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153 h1:yUdfgN0XgIJw7fo github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= +github.com/emicklei/go-restful v2.11.2-0.20200112161605-a7c079c43d51+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= github.com/emicklei/go-restful/v3 v3.8.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/emicklei/go-restful/v3 v3.9.0 h1:XwGDlfxEnQZzuopoqxwSEllNcCOM9DhhFyhFIIGKwxE= github.com/emicklei/go-restful/v3 v3.9.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= @@ -743,6 +771,7 @@ github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d/go.mod h1:ZZM github.com/fatih/camelcase v1.0.0 h1:hxNvNX/xYBp0ovncs8WyWZrOrpBNub/JfaMvbURyft8= github.com/fatih/camelcase v1.0.0/go.mod h1:yN2Sb0lFhZJUdVvtELVWefmrXpuZESvPmqwoZc+/fpc= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= github.com/felixge/httpsnoop v1.0.3 h1:s/nj+GCswXYzN5v2DpNMuMQYe+0DDwt5WVCU6CWBdXk= github.com/felixge/httpsnoop v1.0.3/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= @@ -751,6 +780,7 @@ github.com/form3tech-oss/jwt-go v3.2.3+incompatible/go.mod h1:pbq4aXjuKjdthFRnoD github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k= github.com/frankban/quicktest v1.14.0/go.mod h1:NeW+ay9A/U67EYXNFA1nPE8e/tnQv/09mUdL/ijj8og= github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= +github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= @@ -768,6 +798,7 @@ github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9 github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-ini/ini v1.25.4/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8= +github.com/go-ini/ini v1.63.2/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= @@ -787,6 +818,7 @@ github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre github.com/go-logr/zapr v0.1.0/go.mod h1:tabnROwaDl0UNxkVeFRbY8bwB37GwRv0P8lg6aAiEnk= github.com/go-logr/zapr v1.2.3 h1:a9vnzlIBPQBBkeaR9IuMUfmVOrQlkoC4YfPoFkX3T7A= github.com/go-logr/zapr v1.2.3/go.mod h1:eIauM6P8qSvTw5o2ez6UEAfGjQKrxQTl5EoK+Qa2oG4= +github.com/go-ole/go-ole v1.2.4/go.mod h1:XCwSNxSkXRo4vlyPy93sltvi/qJq0jqQhjqQNIwKuxM= github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE= @@ -800,6 +832,7 @@ github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh github.com/go-openapi/swag v0.19.14/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= github.com/go-openapi/swag v0.22.3 h1:yMBqmnQ0gyZvEb/+KzuWZOXgllrXT4SADYbvDaXHv/g= github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= +github.com/go-ozzo/ozzo-validation v3.5.0+incompatible/go.mod h1:gsEKFIVnabGBt6mXmxK0MoFy+cZoTJY6mu5Ll3LVLBU= github.com/go-playground/locales v0.12.1 h1:2FITxuFt/xuCNP1Acdhv62OzaCiviiE4kotfhkmOqEc= github.com/go-playground/locales v0.12.1/go.mod h1:IUMDtCfWo/w/mtMfIE/IG2K+Ey3ygWanZIBtBW0W2TM= github.com/go-playground/universal-translator v0.0.0-20170327191703-71201497bace h1:vfBaUX49VsqTxXGADDIWvTPvaU4AbQyX/yENHE0f7AY= @@ -827,6 +860,7 @@ github.com/gogo/protobuf v1.3.0/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXP github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= +github.com/golang-collections/collections v0.0.0-20130729185459-604e922904d3/go.mod h1:nPpo7qLxd6XL3hWJG/O60sR8ZKfMCiIoNap5GvD12KU= github.com/golang-jwt/jwt/v4 v4.0.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= github.com/golang-jwt/jwt/v4 v4.2.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= @@ -901,10 +935,12 @@ github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/ github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/gopacket v1.1.19/go.mod h1:iJ8V8n6KS+z2U1A8pUwu8bW5SyEMkXJB8Yo/Vo+TKTo= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/martian/v3 v3.2.1/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= +github.com/google/netstack v0.0.0-20191123085552-55fcc16cd0eb/go.mod h1:r/rILWg3r1Qy9G1IFMhsqWLq2GjwuYoTuPgG7ckMAjk= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= @@ -950,6 +986,7 @@ github.com/googleapis/gnostic v0.5.1/go.mod h1:6U4PtQXGIEt/Z3h5MAT7FNofLnw9vXk2c github.com/googleapis/gnostic v0.5.5/go.mod h1:7+EbHbldMins07ALC74bsA81Ovc97DwqyJO1AENw9kA= github.com/googleapis/go-type-adapters v1.0.0/go.mod h1:zHW75FOG2aur7gAO2B+MLby+cLsWGBF62rFAi7WjWO4= github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= +github.com/gophercloud/gophercloud v0.1.0/go.mod h1:vxM41WHh5uqHVBMZHzuwNOHh8XEoIEcSTewFxm1c5g8= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/handlers v0.0.0-20150720190736-60c7bfde3e33/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ= github.com/gorilla/mux v1.7.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= @@ -975,16 +1012,23 @@ github.com/grpc-ecosystem/grpc-gateway/v2 v2.11.3 h1:lLT7ZLSzGLI08vc9cpd+tYmNWjd github.com/grpc-ecosystem/grpc-gateway/v2 v2.11.3/go.mod h1:o//XUCC/F+yRGJoPO/VU0GSB0f8Nhgmxx0VIRUvaC0w= github.com/hanwen/go-fuse/v2 v2.3.0/go.mod h1:xKwi1cF7nXAOBCXujD5ie0ZKsxc8GGSA1rlMJc+8IJs= github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= +github.com/hashicorp/consul/api v1.12.0/go.mod h1:6pVBMo0ebnYdt2S3H87XhekM/HHrUoTD2XXb/VrZVy0= github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= github.com/hashicorp/errwrap v0.0.0-20141028054710-7554cd9344ce/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= +github.com/hashicorp/go-hclog v1.2.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v0.0.0-20161216184304-ed905158d874/go.mod h1:JMRHfdO9jKNzS/+BTlxCjKNQHg/jZAft8U7LloJvN7I= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= github.com/hashicorp/go-multierror v1.1.0/go.mod h1:spPvp8C1qA32ftKqdAHm4hHTbPw+vmowP0z+KUhOZdA= +github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= +github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= @@ -999,6 +1043,9 @@ github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= +github.com/hashicorp/serf v0.9.7/go.mod h1:TXZNMjZQijwlDvp+r0b63xZ45H7JmCmgg4gpTwn9UV4= +github.com/heketi/heketi v10.3.0+incompatible/go.mod h1:bB9ly3RchcQqsQ9CpyaQwvva7RS5ytVoSoholZQON6o= +github.com/howeyc/fsnotify v0.9.0/go.mod h1:41HzSPxBGeFRQKEEwgh49TRw/nKBsYZ2cF1OzPjSJsA= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= @@ -1014,7 +1061,9 @@ github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/inconshreveable/mousetrap v1.0.1 h1:U3uMjPSQEBMNp1lFxmllqCPM6P5u/Xq7Pgzkat/bFNc= github.com/inconshreveable/mousetrap v1.0.1/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= +github.com/intel/goresctrl v0.2.0/go.mod h1:+CZdzouYFn5EsxgqAQTEzMfwKwuc0fVdMrT9FCCAVRQ= github.com/ishidawataru/sctp v0.0.0-20190723014705-7c296d48a2b5/go.mod h1:DM4VvS+hD/kDi1U1QsX2fnZowwBhqD0Dk3bRPKF/Oc8= +github.com/ishidawataru/sctp v0.0.0-20191218070446-00ab2ac2db07/go.mod h1:co9pwDoBCm1kGxawmb4sPq0cSIOOWNPT4KnHotMP1Zg= github.com/j-keck/arping v0.0.0-20160618110441-2cf9dc699c56/go.mod h1:ymszkNOg6tORTn+6F6j+Jc8TOr5osrynvN6ivFWZ2GA= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= @@ -1022,6 +1071,7 @@ github.com/jmespath/go-jmespath v0.0.0-20160803190731-bd40a432e4c7/go.mod h1:Nht github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= github.com/joefitzgerald/rainbow-reporter v0.1.0/go.mod h1:481CNgqmVHQZzdIbN52CupLJyoVwB10FQ/IQlF1pdL8= +github.com/joho/godotenv v1.4.0/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/jonboulle/clockwork v0.2.2 h1:UOGuzwb1PwsrDAObMuhUnj0p5ULPj8V/xJ7Kx9qUBdQ= github.com/jonboulle/clockwork v0.2.2/go.mod h1:Pkfl5aHPm1nk2H9h0bjmnJD/BcgbGXUBGnn1kMkgxc8= @@ -1039,11 +1089,17 @@ github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHm github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= +github.com/juju/clock v0.0.0-20190205081909-9c5c9712527c/go.mod h1:nD0vlnrUjcjJhqN5WuCWZyzfd5AHZAC9/ajvbSx69xA= +github.com/juju/errors v0.0.0-20200330140219-3fe23663418f/go.mod h1:W54LbzXuIE0boCoNJfwqpmkKJ1O4TCTZMetAt6jGk7Q= +github.com/juju/mutex v0.0.0-20180619145857-d21b13acf4bf/go.mod h1:Y3oOzHH8CQ0Ppt0oCKJ2JFO81/EsWenH5AEqigLH+yY= +github.com/juju/testing v0.0.0-20200608005635-e4eedbc6f7aa/go.mod h1:hpGvhGHPVbNBraRLZEhoQwFLMrjK8PSlO4D3nDjKYXo= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= +github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0/go.mod h1:1NbS8ALrpOvjt0rHPNLyCIeMtbizbir8U//inJ+zuB8= github.com/karrick/godirwalk v1.17.0/go.mod h1:j4mkqPuvaLI8mp1DroR3P6ad7cyYd4c1qeJ3RV7ULlk= github.com/kelseyhightower/envconfig v0.0.0-20180517194557-dd1402a4d99d h1:Tqg6yg0as+P38tbKytv9/yk+ifNq0CrvjlgADEniKog= github.com/kelseyhightower/envconfig v0.0.0-20180517194557-dd1402a4d99d/go.mod h1:cccZRl6mQpaq41TPp5QxidR+Sa3axMbJDNb//FQX6Gg= +github.com/kelseyhightower/memkv v0.1.1/go.mod h1:uIeINg0Dy2aioPWSdga9VnueJjfSvul2dW7o758NxO4= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= @@ -1061,6 +1117,7 @@ github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfn github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -1069,6 +1126,7 @@ github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348/go.mod h1:B69LE github.com/leodido/go-urn v0.0.0-20181204092800-a67a23e1c1af h1:EhEGUQX36JFkvSWzrwGjjTJxrx7atfJdxv8cxFzmaB0= github.com/leodido/go-urn v0.0.0-20181204092800-a67a23e1c1af/go.mod h1:+cyI34gQWZcE1eQU7NVgKkkzdXDQHr1dBMtdAPozLkw= github.com/libopenstorage/openstorage v1.0.0/go.mod h1:Sp1sIObHjat1BeXhfMqLZ14wnOzEhNx2YQedreMcUyc= +github.com/libp2p/go-reuseport v0.1.0/go.mod h1:bQVn9hmfcTaoo0c9v5pBhOarsU1eNOBZdaAd2hzXRKU= github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de h1:9TO3cAIGXtEhnIaL+V+BEER86oLrvS+kWobKpbJuye0= github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de/go.mod h1:zAbeS9B/r2mtpb6U+EI2rYA5OAXxsYw6wTamcNW+zcE= github.com/linuxkit/virtsock v0.0.0-20201010232012-f8cee7dfc7a3/go.mod h1:3r6x7q95whyfWQpmGZTu3gk3v2YkMi05HEzl7Tf7YEo= @@ -1088,9 +1146,11 @@ github.com/marstr/guid v1.1.0/go.mod h1:74gB1z2wpxxInTG6yaqA7KrtM0NZ+RbrcqDvYHef github.com/mattbaird/jsonpatch v0.0.0-20171005235357-81af80346b1a/go.mod h1:M1qoD/MqPgTZIk0EWKB38wE28ACRfVcn+cU08jyArI0= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= +github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= +github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-runewidth v0.0.7 h1:Ei8KR0497xHyKJPAv59M1dkC+rOZCMBJ+t3fZ+twI54= github.com/mattn/go-runewidth v0.0.7/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/mattn/go-shellwords v1.0.3/go.mod h1:3xCvwCdWdlDJUrvuMn7Wuy9eWs4pE8vqg+NOMyg4B2o= @@ -1100,14 +1160,17 @@ github.com/matttproud/golang_protobuf_extensions v1.0.2/go.mod h1:BSXmuO+STAnVfr github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= github.com/maxbrunsfeld/counterfeiter/v6 v6.2.2/go.mod h1:eD9eIE7cdwcMi9rYluz88Jz2VyhSmden33/aXg4oVIY= +github.com/mcuadros/go-version v0.0.0-20190308113854-92cdf37c5b75/go.mod h1:76rfSfYPWj01Z85hUf/ituArm797mNKcvINh1OlsZKo= github.com/mdlayher/genetlink v1.0.0/go.mod h1:0rJ0h4itni50A86M2kHcgS85ttZazNt7a8H2a2cw0Gc= github.com/mdlayher/netlink v0.0.0-20190409211403-11939a169225/go.mod h1:eQB3mZE4aiYnlUsyGGCOpPETfdQq4Jhsgf1fk3cwQaA= github.com/mdlayher/netlink v1.0.0/go.mod h1:KxeJAFOFLG6AjpyDkQ/iIhxygIUKD+vcwqcnu43w/+M= github.com/mdlayher/netlink v1.1.0/go.mod h1:H4WCitaheIsdF9yOYu8CFmCgQthAPIWZmcKp9uZHgmY= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/miekg/pkcs11 v1.0.3/go.mod h1:XsNlhZGX73bx86s2hdc/FuaLm2CPZJemRLMA+WTFxgs= +github.com/miekg/pkcs11 v1.1.1/go.mod h1:XsNlhZGX73bx86s2hdc/FuaLm2CPZJemRLMA+WTFxgs= github.com/mikioh/ipaddr v0.0.0-20190404000644-d465c8ab6721/go.mod h1:Ickgr2WtCLZ2MDGd4Gr0geeCH5HybhRJbonOgQpvSxc= github.com/mindprince/gonvml v0.0.0-20190828220739-9ebdce4bb989/go.mod h1:2eu9pRWp8mo84xCg6KswZ+USQHjwgRhNp06sozOdsTY= +github.com/mipearson/rfw v0.0.0-20170619235010-6f0a6f3266ba/go.mod h1:cktvQyh8cOIjSrvwci34qvQq2seh3CvrJNn3qqH//CE= github.com/mistifyio/go-zfs v2.1.2-0.20190413222219-f784269be439+incompatible/go.mod h1:8AuVvqP/mXw1px98n46wfvcGfQ4ci2FwoAjKYxuo3Z4= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= @@ -1136,6 +1199,7 @@ github.com/moby/sys/mountinfo v0.6.2/go.mod h1:IJb6JQeOklcdMU9F5xQ8ZALD+CUr5VlGp github.com/moby/sys/signal v0.6.0 h1:aDpY94H8VlhTGa9sNYUFCFsMZIUh5wm0B6XkIoJj/iY= github.com/moby/sys/signal v0.6.0/go.mod h1:GQ6ObYZfqacOwTtlXvcmh9A26dVRul/hbOZn88Kg8Tg= github.com/moby/sys/symlink v0.1.0/go.mod h1:GGDODQmbFOjFsXvfLVn3+ZRxkch54RkSiGqsZeMYowQ= +github.com/moby/sys/symlink v0.2.0/go.mod h1:7uZVF2dqJjG/NsClqul95CqKOBRQyYSNnJ6BMgR/gFs= github.com/moby/term v0.0.0-20220808134915-39b0c02b01ae h1:O4SWKdcHVCvYqyDV+9CJA1fcDN2L11Bule0iFy3YlAI= github.com/moby/term v0.0.0-20220808134915-39b0c02b01ae/go.mod h1:E2VnQOmVuvZB6UYnnDB0qG5Nq/1tD9acaOpo6xmt0Kw= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -1160,8 +1224,10 @@ github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRW github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f h1:y5//uYreIhSUg3J1GEMiLbxo1LJaP8RfCpH6pymGZus= github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= +github.com/natefinch/atomic v0.0.0-20150920032501-a62ce929ffcc/go.mod h1:1rLVY/DWf3U6vSZgH16S7pymfrhK2lcUlXjgGglw/lY= github.com/ncw/swift v1.0.47/go.mod h1:23YIA4yWVnGwv2dQlN4bB7egfYX6YLn0Yo/S6zZO/ZM= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= +github.com/nmrshll/go-cp v0.0.0-20180115193924-61436d3b7cfa/go.mod h1:/Uh/WFiWYXoTKVsM302U10XnogAldY7up/xErXmt1FA= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= @@ -1240,6 +1306,7 @@ github.com/opencontainers/selinux v1.10.1 h1:09LIPVRP3uuZGQvgR+SgMSNBd1Eb3vlRbGq github.com/opencontainers/selinux v1.10.1/go.mod h1:2i0OySw99QjzBBQByd1Gr9gSjvuho1lHsJxIJ3gGbJI= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= +github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE= github.com/pelletier/go-toml v1.8.1/go.mod h1:T2/BmBdy8dvIRq1a/8aqjN41wvWlN4lrapLU/GW4pbc= @@ -1254,6 +1321,7 @@ github.com/pkg/errors v0.8.1-0.20171018195549-f15c970de5b7/go.mod h1:bwawxfHBFNV github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/profile v1.6.0/go.mod h1:qBsxPvzyUincmltOk6iyRVxHYg4adc0OFOv72ZdLa18= github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= @@ -1312,12 +1380,15 @@ github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1 github.com/prometheus/procfs v0.8.0 h1:ODq8ZFEaYeCaZOJlZZdJA2AbQR98dSHSM1KW/You5mo= github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= +github.com/quobyte/api v0.1.8/go.mod h1:jL7lIHrmqQ7yh05OJ+eEEdHr0u/kmT1Ff9iHd+4H6VI= +github.com/rakelkar/gonetsh v0.3.2/go.mod h1:MkEXf5yV9DRTy8TfpWdvMuCTkxajNE/0tn9pvZ6ikDw= github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= +github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= github.com/rubiojr/go-vhd v0.0.0-20200706105327-02e210299021/go.mod h1:DM5xW0nvfNNm2uytzsvhI3OnX8uzaRAg8UX/CnDqbto= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= @@ -1325,6 +1396,8 @@ github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/safchain/ethtool v0.0.0-20190326074333-42ed695e3de8/go.mod h1:Z0q5wiBQGYcxhMZ6gUqHn6pYNLypFAvaL3UvgZLR0U4= +github.com/safchain/ethtool v0.0.0-20210803160452-9aa261dae9b1/go.mod h1:Z0q5wiBQGYcxhMZ6gUqHn6pYNLypFAvaL3UvgZLR0U4= +github.com/sagikazarmark/crypt v0.6.0/go.mod h1:U8+INwJo3nBv1m6A/8OBXAq7Jnpspk5AxSgDyEQcea8= github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= github.com/sclevine/spec v1.2.0/go.mod h1:W4J29eT/Kzv7/b9IWLB055Z+qvVC9vt0Arko24q7p+U= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= @@ -1332,6 +1405,8 @@ github.com/seccomp/libseccomp-golang v0.9.1/go.mod h1:GbW5+tmTXfcxTToHLXlScSlAvW github.com/seccomp/libseccomp-golang v0.9.2-0.20220502022130-f33da4d89646/go.mod h1:JA8cRccbGaA1s33RQf7Y1+q9gHmZX1yB/z9WDN1C6fg= github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0= github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= +github.com/shirou/gopsutil v0.0.0-20190323131628-2cbc9195c892/go.mod h1:WWnYX4lzhCH5h/3YBfyVA3VbLYjlMZZAQcW9ojMexNc= +github.com/shirou/w32 v0.0.0-20160930032740-bb4de0191aa4/go.mod h1:qsXQc7+bwAM3Q1u/4XEfrquwF8Lw7D7y5cD8CuHnfIc= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.0.4-0.20170822132746-89742aefa4b2/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc= github.com/sirupsen/logrus v1.0.6/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc= @@ -1382,6 +1457,7 @@ github.com/spf13/viper v1.12.0/go.mod h1:b6COn30jlNxbm/V2IqWiNWkJ+vZNiMNksliPCiu github.com/stefanberger/go-pkcs11uri v0.0.0-20201008174630-78d3cae3a980/go.mod h1:AO3tvPzVZ/ayst6UlUKUv6rcPQInYe3IknH3jYhAKu8= github.com/stoewer/go-strcase v1.2.0 h1:Z2iHWqGXH00XYgqDmNgQbIBxf3wrNq0F3feEy0ainaU= github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8= +github.com/storageos/go-api v2.2.0+incompatible/go.mod h1:ZrLn+e0ZuF3Y65PNF6dIwbJPZqfmtCXxFm9ckv0agOY= github.com/stretchr/objx v0.0.0-20180129172003-8a3f7159479f/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -1389,6 +1465,7 @@ github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoH github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= +github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v0.0.0-20180303142811-b89eecf5ca5d/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= @@ -1408,6 +1485,8 @@ github.com/syndtr/gocapability v0.0.0-20170704070218-db04d3cc01c8/go.mod h1:hkRG github.com/syndtr/gocapability v0.0.0-20180916011248-d98352740cb2/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= github.com/tchap/go-patricia v2.2.6+incompatible/go.mod h1:bmLyhP68RS6kStMGxByiQ23RP/odRBOTVjwp2cDyi6I= +github.com/tchap/go-patricia/v2 v2.3.1/go.mod h1:VZRHKAb53DLaG+nA9EaYYiaEx6YztwDlLElMsnSHD4k= +github.com/termie/go-shutil v0.0.0-20140729215957-bcacb06fecae/go.mod h1:quDq6Se6jlGwiIKia/itDZxqC5rj6/8OdFyMMAwTxCs= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tmc/grpc-websocket-proxy v0.0.0-20201229170055-e5319fda7802 h1:uruHq4dN7GR16kFc5fp3d1RIYzJW5onx8Ybykw2YQFA= github.com/tmc/grpc-websocket-proxy v0.0.0-20201229170055-e5319fda7802/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= @@ -1481,6 +1560,7 @@ go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= +go.opentelemetry.io/contrib v0.20.0/go.mod h1:G/EtFaa6qaN7+LxqfIAT3GiZa7Wv5DTBUzl5H4LY0Kc= go.opentelemetry.io/contrib/instrumentation/github.com/emicklei/go-restful/otelrestful v0.35.0/go.mod h1:DQYkU9srMFqLUTVA/7/WlRHdnYDB7wyMMlle2ktMjfI= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.25.0/go.mod h1:E5NNboN0UqSAki0Atn9kVwaN7I+l25gGxDqBueo/74E= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.35.0 h1:xFSRQBbXF6VvYRf2lqMJXxoB72XI1K/azav8TekHHSw= @@ -1492,6 +1572,7 @@ go.opentelemetry.io/otel v1.0.1/go.mod h1:OPEOD4jIT2SlZPMmwT6FqZz2C0ZNdQqiWcoK6M go.opentelemetry.io/otel v1.8.0/go.mod h1:2pkj+iMj0o03Y+cW6/m8Y4WkRdYN3AvCXCnzRMp9yvM= go.opentelemetry.io/otel v1.10.0 h1:Y7DTJMR6zs1xkS/upamJYk0SxxN4C9AqRd77jmZnyY4= go.opentelemetry.io/otel v1.10.0/go.mod h1:NbvWjCthWHKBEUMpf0/v8ZRZlni86PpGFEMA9pnQSnQ= +go.opentelemetry.io/otel/exporters/otlp v0.20.0/go.mod h1:YIieizyaN77rtLJra0buKiNBOm9XQfkPEKBeuhoMwAM= go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.10.0 h1:TaB+1rQhddO1sF71MpZOZAuSPW1klK2M8XxfrBMfK7Y= go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.10.0/go.mod h1:78XhIg8Ht9vR4tbLNUhXsiOnE2HOuSeKAiAcoVQEpOY= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.0.1/go.mod h1:Kv8liBeVNFkkkbilbgWRpV+wWuu+H5xdOT6HAgd30iw= @@ -1500,11 +1581,14 @@ go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.10.0/go.mod h1:Krqnjl22jUJ0 go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.0.1/go.mod h1:xOvWoTOrQjxjW61xtOmD/WKGRYb/P4NzRo3bs65U6Rk= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.10.0 h1:KtiUEhQmj/Pa874bVYKGNVdq8NPKiacPbaRRtgXi+t4= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.10.0/go.mod h1:OfUCyyIiDvNXHWpcWgbF+MWvqPZiNa3YDEnivcnYsV0= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.3.0/go.mod h1:QNX1aly8ehqqX1LEa6YniTU7VY9I6R3X/oPxhGdTceE= go.opentelemetry.io/otel/metric v0.31.0 h1:6SiklT+gfWAwWUR0meEMxQBtihpiEs4c+vL9spDTqUs= go.opentelemetry.io/otel/metric v0.31.0/go.mod h1:ohmwj9KTSIeBnDBm/ZwH2PSZxZzoOaG2xZeekTRzL5A= go.opentelemetry.io/otel/sdk v1.0.1/go.mod h1:HrdXne+BiwsOHYYkBE5ysIcv2bvdZstxzmCQhxTcZkI= go.opentelemetry.io/otel/sdk v1.10.0 h1:jZ6K7sVn04kk/3DNUdJ4mqRlGDiXAVuIG+MMENpTNdY= go.opentelemetry.io/otel/sdk v1.10.0/go.mod h1:vO06iKzD5baltJz1zarxMCNHFpUlUiOy4s65ECtn6kE= +go.opentelemetry.io/otel/sdk/export/metric v0.20.0/go.mod h1:h7RBNMsDJ5pmI1zExLi+bJK+Dr8NQCh0qGhm1KDnNlE= +go.opentelemetry.io/otel/sdk/metric v0.20.0/go.mod h1:knxiS8Xd4E/N+ZqKmUPf3gTTZ4/0TjTXukfxjzSTpHE= go.opentelemetry.io/otel/trace v1.0.1/go.mod h1:5g4i4fKLaX2BQpSBsxw8YYcgKpMMSW3x7ZTuYBr3sUk= go.opentelemetry.io/otel/trace v1.8.0/go.mod h1:0Bt3PXY8w+3pheS3hQUt+wow8b1ojPaTBoTCh2zIFI4= go.opentelemetry.io/otel/trace v1.10.0 h1:npQMbR8o7mum8uF95yFbOEJffhs1sbCOfDh8zAJiH5E= @@ -1523,6 +1607,7 @@ go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= go.uber.org/goleak v1.1.12/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/goleak v1.2.0 h1:xqgm/S+aQvhWFTtR0XK3Jvg7z8kGV8P4X14IzwN3Eqk= +go.uber.org/goleak v1.2.0/go.mod h1:XJYK+MuIchqpmGmUSAzotztawfKvYLUIgg7guXrwVUo= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= go.uber.org/multierr v1.8.0 h1:dg6GjLku4EH+249NNmoIciG9N/jURbDG+pFlTkhzIC8= @@ -2214,9 +2299,11 @@ gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntN gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/fsnotify/fsnotify.v1 v1.4.7/go.mod h1:Fyux9zXlo4rWoMSIzpn9fDAYjalPqJ/K1qJ27s+7ltE= gopkg.in/gcfg.v1 v1.2.0/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2/go.mod h1:Xk6kEKp8OKb+X14hQBKWaSkCsqBpgog8nAV2xsGOxlo= gopkg.in/go-playground/assert.v1 v1.2.1 h1:xoYuJVE7KT85PYWrN730RguIQO0ePzVRfFMXadIrXTM= +gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE= gopkg.in/go-playground/validator.v9 v9.27.0 h1:wCg/0hk9RzcB0CYw8pYV6FiBYug1on0cpco9YZF8jqA= gopkg.in/go-playground/validator.v9 v9.27.0/go.mod h1:+c9/zcJMFNgbLvly1L1V+PpxWdVbfP1avr/N00E2vyQ= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= @@ -2338,6 +2425,7 @@ k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9/go.mod h1:jPW/WVKK9YHAvNhRxK0md/ k8s.io/utils v0.0.0-20221107191617-1a15be271d1d/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= k8s.io/utils v0.0.0-20221128185143-99ec85e7a448 h1:KTgPnR10d5zhztWptI952TNtt/4u5h3IzDXkdIMuo2Y= k8s.io/utils v0.0.0-20221128185143-99ec85e7a448/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= +modernc.org/memory v1.0.5/go.mod h1:B7OYswTRnfGg+4tDH1t1OeUNnsy2viGTdME4tzd+IjM= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= @@ -2352,6 +2440,7 @@ sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2/go.mod h1:B8JuhiUyNFVKdsE8h6 sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= sigs.k8s.io/kind v0.8.1/go.mod h1:oNKTxUVPYkV9lWzY6CVMNluVq8cBsyq+UgPJdvA3uu4= +sigs.k8s.io/kind v0.11.1/go.mod h1:fRpgVhtqAWrtLB9ED7zQahUimpUXuG/iHT88xYqEGIA= sigs.k8s.io/kustomize/api v0.12.1 h1:7YM7gW3kYBwtKvoY216ZzY+8hM+lV53LUayghNRJ0vM= sigs.k8s.io/kustomize/api v0.12.1/go.mod h1:y3JUhimkZkR6sbLNwfJHxvo1TCLwuwm14sCYnkH6S1s= sigs.k8s.io/kustomize/cmd/config v0.10.9/go.mod h1:T0s850zPV3wKfBALA0dyeP/K74jlJcoP8Pr9ZWwE3MQ= diff --git a/pkg/clustertree/cluster-manager/controllers/node_lease_controller.go b/pkg/clustertree/cluster-manager/controllers/node_lease_controller.go index 31eedd15c..93562cbd9 100644 --- a/pkg/clustertree/cluster-manager/controllers/node_lease_controller.go +++ b/pkg/clustertree/cluster-manager/controllers/node_lease_controller.go @@ -2,6 +2,7 @@ package controllers import ( "context" + "reflect" "sync" "time" @@ -19,6 +20,8 @@ import ( kosmosv1alpha1 "github.com/kosmos.io/kosmos/pkg/apis/kosmos/v1alpha1" leafUtils "github.com/kosmos.io/kosmos/pkg/clustertree/cluster-manager/utils" + "github.com/kosmos.io/kosmos/pkg/utils/podutils" + "github.com/pkg/errors" ) const ( @@ -28,6 +31,7 @@ const ( DefaultRenewIntervalFraction = 0.25 DefaultNodeStatusUpdateInterval = 1 * time.Minute + DefaultpodStatusUpdateInterval = 10 * time.Second ) type NodeLeaseController struct { @@ -36,8 +40,9 @@ type NodeLeaseController struct { root client.Client LeafModelHandler leafUtils.LeafModelHandler - leaseInterval time.Duration - statusInterval time.Duration + leaseInterval time.Duration + statusInterval time.Duration + podstatusInterval time.Duration nodes []*corev1.Node LeafNodeSelectors map[string]kosmosv1alpha1.NodeSelector @@ -54,6 +59,7 @@ func NewNodeLeaseController(leafClient kubernetes.Interface, root client.Client, LeafNodeSelectors: LeafNodeSelectors, leaseInterval: getRenewInterval(), statusInterval: DefaultNodeStatusUpdateInterval, + podstatusInterval: DefaultpodStatusUpdateInterval, } return c } @@ -61,6 +67,7 @@ func NewNodeLeaseController(leafClient kubernetes.Interface, root client.Client, func (c *NodeLeaseController) Start(ctx context.Context) error { go wait.UntilWithContext(ctx, c.syncLease, c.leaseInterval) go wait.UntilWithContext(ctx, c.syncNodeStatus, c.statusInterval) + go wait.UntilWithContext(ctx, c.syncpodStatus, c.podstatusInterval) <-ctx.Done() return nil } @@ -89,6 +96,60 @@ func (c *NodeLeaseController) updateNodeStatus(ctx context.Context, n []*corev1. return nil } +func (c *NodeLeaseController) syncpodStatus(ctx context.Context) { + err := c.updatepodStatus(ctx) + if err != nil { + klog.Errorf(err.Error()) + } +} + +func (c *NodeLeaseController) updatepodStatus(ctx context.Context) error { + + pods, err := c.leafClient.CoreV1().Pods(metav1.NamespaceAll).List(ctx, metav1.ListOptions{}) + if err != nil { + klog.Errorf("Could not list pods in leaf cluster,Error: %v", err) + } + + var wg sync.WaitGroup + for _, leafpod := range pods.Items { + wg.Add(1) + go func(leafpod corev1.Pod) { + defer wg.Done() + err = retry.RetryOnConflict(retry.DefaultRetry, func() error { + rootpod := &corev1.Pod{} + if err := c.root.Get(ctx, types.NamespacedName{Name: leafpod.Name, Namespace: leafpod.Namespace}, rootpod); err != nil { + if apierrors.IsNotFound(err) { + klog.Warningf("Pod %s in namespace %s not found in root cluster, skipping...", leafpod.Name, leafpod.Namespace) + return nil + } + //klog.Warningf("Could not get pod in root cluster, Error: %v", err) + return err + } + if podutils.IsKosmosPod(rootpod) && !reflect.DeepEqual(rootpod.Status, leafpod.Status) { + rPodCopy := rootpod.DeepCopy() + rPodCopy.Status = leafpod.Status + //klog.Errorf("leafpod Status.Conditions in root:%+v", leafpod.Status.Conditions) + //klog.Errorf("rPodCopy  status.Conditions after in root:%+v", rPodCopy.Status.Conditions) + podutils.FitObjectMeta(&rPodCopy.ObjectMeta) + if err := c.root.Status().Update(ctx, rPodCopy); err != nil && !apierrors.IsNotFound(err) { + klog.V(4).Info(errors.Wrap(err, "error while updating pod status in kubernetes")) + return nil + } + } + return nil + }) + + if err != nil { + klog.Errorf("Failed to update pod %s/%s, error: %v", leafpod.Namespace, leafpod.Name, err) + } + + }(leafpod) + } + + wg.Wait() + return nil +} + func (c *NodeLeaseController) syncLease(ctx context.Context) { nodes := make([]*corev1.Node, 0) c.nodeLock.Lock() diff --git a/pkg/clustertree/cluster-manager/controllers/pod/leaf_pod_controller.go b/pkg/clustertree/cluster-manager/controllers/pod/leaf_pod_controller.go index 9281c10e7..16f0b77f2 100644 --- a/pkg/clustertree/cluster-manager/controllers/pod/leaf_pod_controller.go +++ b/pkg/clustertree/cluster-manager/controllers/pod/leaf_pod_controller.go @@ -10,6 +10,7 @@ import ( apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" + "k8s.io/client-go/util/retry" "k8s.io/klog/v2" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/builder" @@ -35,33 +36,38 @@ type LeafPodReconciler struct { } func (r *LeafPodReconciler) Reconcile(ctx context.Context, request reconcile.Request) (reconcile.Result, error) { - var pod corev1.Pod - if err := r.Get(ctx, request.NamespacedName, &pod); err != nil { - if apierrors.IsNotFound(err) { - // delete pod in root - if err := DeletePodInRootCluster(ctx, request.NamespacedName, r.RootClient); err != nil { - return reconcile.Result{RequeueAfter: utils.DefaultRequeueTime}, nil + + err := retry.RetryOnConflict(retry.DefaultRetry, func() error { + var pod corev1.Pod + if err := r.Get(ctx, request.NamespacedName, &pod); err != nil { + if apierrors.IsNotFound(err) { + // delete pod in root + if err := DeletePodInRootCluster(ctx, request.NamespacedName, r.RootClient); err != nil { + return err + } + return nil } - return reconcile.Result{}, nil + klog.Errorf("get %s error: %v", request.NamespacedName, err) + return err } - klog.Errorf("get %s error: %v", request.NamespacedName, err) - return reconcile.Result{RequeueAfter: utils.DefaultRequeueTime}, nil - } - - podCopy := pod.DeepCopy() - // if ShouldSkipStatusUpdate(podCopy) { - // return reconcile.Result{}, nil - // } + podCopy := pod.DeepCopy() - if podutils.IsKosmosPod(podCopy) { - podutils.FitObjectMeta(&podCopy.ObjectMeta) - podCopy.ResourceVersion = "0" - if err := r.RootClient.Status().Update(ctx, podCopy); err != nil && !apierrors.IsNotFound(err) { - klog.V(4).Info(errors.Wrap(err, "error while updating pod status in kubernetes")) - return reconcile.Result{RequeueAfter: utils.DefaultRequeueTime}, nil + if podutils.IsKosmosPod(podCopy) { + podutils.FitObjectMeta(&podCopy.ObjectMeta) + if err := r.RootClient.Status().Update(ctx, podCopy); err != nil && !apierrors.IsNotFound(err) { + klog.V(4).Info(errors.Wrap(err, "error while updating pod status in kubernetes")) + return err + } } + + return nil + }) + + if err != nil { + return reconcile.Result{RequeueAfter: utils.DefaultRequeueTime}, err } + return reconcile.Result{}, nil } From 2e8aa97ee18acb00fb001a556146023058d86b61 Mon Sep 17 00:00:00 2001 From: gaoyuan Date: Wed, 30 Oct 2024 16:23:56 +0800 Subject: [PATCH 2/5] sync_globalnodestatus --- cmd/kubenest/operator/app/operator.go | 24 ++- .../controllers/node_lease_controller.go | 10 +- .../controllers/node_lease_controller_test.go | 59 ++++++ .../controllers/pod/leaf_pod_controller.go | 1 + .../global_node_controller.go | 192 ++++++++++++++++++ .../node_controller.go | 73 +++++++ .../virtualcluster_init_controller.go | 2 +- 7 files changed, 351 insertions(+), 10 deletions(-) create mode 100644 pkg/clustertree/cluster-manager/controllers/node_lease_controller_test.go diff --git a/cmd/kubenest/operator/app/operator.go b/cmd/kubenest/operator/app/operator.go index 35d38067c..70dcbbe7b 100644 --- a/cmd/kubenest/operator/app/operator.go +++ b/cmd/kubenest/operator/app/operator.go @@ -218,11 +218,11 @@ func run(ctx context.Context, config *config.Config) error { } mgr, err := controllerruntime.NewManager(config.RestConfig, controllerruntime.Options{ - Logger: klog.Background(), - Scheme: newscheme, - LeaderElection: config.LeaderElection.LeaderElect, - LeaderElectionID: config.LeaderElection.ResourceName, - LeaderElectionNamespace: config.LeaderElection.ResourceNamespace, + Logger: klog.Background(), + Scheme: newscheme, + // LeaderElection: config.LeaderElection.LeaderElect, + // LeaderElectionID: config.LeaderElection.ResourceName, + // LeaderElectionNamespace: config.LeaderElection.ResourceNamespace, }) if err != nil { return fmt.Errorf("failed to build controller manager: %v", err) @@ -261,6 +261,13 @@ func run(ctx context.Context, config *config.Config) error { return fmt.Errorf("error starting %s: %v", constants.GlobalNodeControllerName, err) } + //启动 GlobalNodeController的定时同步 + // go func() { + // if err := GlobalNodeController.Start(ctx); err != nil { + // klog.Errorf("error starting GlobalNodeController: %v", err) + // } + // }() + if err := startEndPointsControllers(mgr); err != nil { return err } @@ -277,6 +284,13 @@ func run(ctx context.Context, config *config.Config) error { return fmt.Errorf("error starting %s: %v", constants.NodeControllerName, err) } + //启动 VirtualClusterNodeController的定时同步 + go func() { + if err := VirtualClusterNodeController.Start(ctx); err != nil { + klog.Errorf("error starting VirtualClusterNodeController: %v", err) + } + }() + if config.KubeNestOptions.KubeNestType == v1alpha1.KosmosKube { KosmosJoinController := kosmos.KosmosJoinController{ Client: mgr.GetClient(), diff --git a/pkg/clustertree/cluster-manager/controllers/node_lease_controller.go b/pkg/clustertree/cluster-manager/controllers/node_lease_controller.go index 93562cbd9..b5d66f9ed 100644 --- a/pkg/clustertree/cluster-manager/controllers/node_lease_controller.go +++ b/pkg/clustertree/cluster-manager/controllers/node_lease_controller.go @@ -2,6 +2,7 @@ package controllers import ( "context" + "fmt" "reflect" "sync" "time" @@ -20,6 +21,7 @@ import ( kosmosv1alpha1 "github.com/kosmos.io/kosmos/pkg/apis/kosmos/v1alpha1" leafUtils "github.com/kosmos.io/kosmos/pkg/clustertree/cluster-manager/utils" + "github.com/kosmos.io/kosmos/pkg/utils" "github.com/kosmos.io/kosmos/pkg/utils/podutils" "github.com/pkg/errors" ) @@ -105,7 +107,9 @@ func (c *NodeLeaseController) syncpodStatus(ctx context.Context) { func (c *NodeLeaseController) updatepodStatus(ctx context.Context) error { - pods, err := c.leafClient.CoreV1().Pods(metav1.NamespaceAll).List(ctx, metav1.ListOptions{}) + pods, err := c.leafClient.CoreV1().Pods(metav1.NamespaceAll).List(ctx, metav1.ListOptions{ + LabelSelector: fmt.Sprintf("%s!=%s", utils.KosmosPodLabel, utils.KosmosNodeValue), + }) if err != nil { klog.Errorf("Could not list pods in leaf cluster,Error: %v", err) } @@ -133,7 +137,7 @@ func (c *NodeLeaseController) updatepodStatus(ctx context.Context) error { podutils.FitObjectMeta(&rPodCopy.ObjectMeta) if err := c.root.Status().Update(ctx, rPodCopy); err != nil && !apierrors.IsNotFound(err) { klog.V(4).Info(errors.Wrap(err, "error while updating pod status in kubernetes")) - return nil + return err } } return nil @@ -142,10 +146,8 @@ func (c *NodeLeaseController) updatepodStatus(ctx context.Context) error { if err != nil { klog.Errorf("Failed to update pod %s/%s, error: %v", leafpod.Namespace, leafpod.Name, err) } - }(leafpod) } - wg.Wait() return nil } diff --git a/pkg/clustertree/cluster-manager/controllers/node_lease_controller_test.go b/pkg/clustertree/cluster-manager/controllers/node_lease_controller_test.go new file mode 100644 index 000000000..e4e75c3e3 --- /dev/null +++ b/pkg/clustertree/cluster-manager/controllers/node_lease_controller_test.go @@ -0,0 +1,59 @@ +package controllers + +import ( + "context" + "sync" + "testing" + "time" + + kosmosv1alpha1 "github.com/kosmos.io/kosmos/pkg/apis/kosmos/v1alpha1" + leafUtils "github.com/kosmos.io/kosmos/pkg/clustertree/cluster-manager/utils" + corev1 "k8s.io/api/core/v1" + "k8s.io/client-go/kubernetes" + "sigs.k8s.io/controller-runtime/pkg/client" +) + +func TestNodeLeaseController_updatepodStatus(t *testing.T) { + type fields struct { + leafClient kubernetes.Interface + rootClient kubernetes.Interface + root client.Client + LeafModelHandler leafUtils.LeafModelHandler + leaseInterval time.Duration + statusInterval time.Duration + podstatusInterval time.Duration + nodes []*corev1.Node + LeafNodeSelectors map[string]kosmosv1alpha1.NodeSelector + nodeLock sync.Mutex + } + type args struct { + ctx context.Context + } + tests := []struct { + name string + fields fields + args args + wantErr bool + }{ + // TODO: Add test cases. + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + c := &NodeLeaseController{ + leafClient: tt.fields.leafClient, + rootClient: tt.fields.rootClient, + root: tt.fields.root, + LeafModelHandler: tt.fields.LeafModelHandler, + leaseInterval: tt.fields.leaseInterval, + statusInterval: tt.fields.statusInterval, + podstatusInterval: tt.fields.podstatusInterval, + nodes: tt.fields.nodes, + LeafNodeSelectors: tt.fields.LeafNodeSelectors, + nodeLock: tt.fields.nodeLock, + } + if err := c.updatepodStatus(tt.args.ctx); (err != nil) != tt.wantErr { + t.Errorf("NodeLeaseController.updatepodStatus() error = %v, wantErr %v", err, tt.wantErr) + } + }) + } +} diff --git a/pkg/clustertree/cluster-manager/controllers/pod/leaf_pod_controller.go b/pkg/clustertree/cluster-manager/controllers/pod/leaf_pod_controller.go index 16f0b77f2..c14ed6985 100644 --- a/pkg/clustertree/cluster-manager/controllers/pod/leaf_pod_controller.go +++ b/pkg/clustertree/cluster-manager/controllers/pod/leaf_pod_controller.go @@ -37,6 +37,7 @@ type LeafPodReconciler struct { func (r *LeafPodReconciler) Reconcile(ctx context.Context, request reconcile.Request) (reconcile.Result, error) { + //retry.RetryOnConflict位置 err := retry.RetryOnConflict(retry.DefaultRetry, func() error { var pod corev1.Pod if err := r.Get(ctx, request.NamespacedName, &pod); err != nil { diff --git a/pkg/kubenest/controller/global.node.controller/global_node_controller.go b/pkg/kubenest/controller/global.node.controller/global_node_controller.go index a9dbacdb7..690a78799 100644 --- a/pkg/kubenest/controller/global.node.controller/global_node_controller.go +++ b/pkg/kubenest/controller/global.node.controller/global_node_controller.go @@ -2,6 +2,7 @@ package globalnodecontroller import ( "context" + "time" v1 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" @@ -30,11 +31,16 @@ import ( "github.com/kosmos.io/kosmos/pkg/utils" ) +const ( + NodestatusUpdatefrequency = 10 * time.Second +) + type GlobalNodeController struct { client.Client RootClientSet kubernetes.Interface EventRecorder record.EventRecorder KosmosClient versioned.Interface + //syncNodeStatusMux sync.Mutex } // compareMaps compares two map[string]string and returns true if they are equal @@ -121,9 +127,186 @@ func (r *GlobalNodeController) newVirtualClusterMapFunc() handler.MapFunc { // } // } +// func (r *GlobalNodeController) Start(ctx context.Context) error { +// // globalnodes := make([]*v1alpha1.GlobalNodeList, 0) +// // c.nodeLock.Lock() +// // for _, nodeIndex := range c.nodes { +// // nodeCopy := nodeIndex.DeepCopy() +// // nodes = append(nodes, nodeCopy) +// // } +// // c.nodeLock.Unlock() + +// // err := c.updateNodeStatus(ctx, nodes, c.LeafNodeSelectors) +// // if err != nil { +// // klog.Errorf(err.Error()) +// // } + +// go wait.UntilWithContext(ctx, func(ctx context.Context) { + +// r.syncNodeStatusMux.Lock() +// defer r.syncNodeStatusMux.Unlock() + +// var globalNodeList v1alpha1.GlobalNodeList +// if err := r.List(ctx, &globalNodeList); err != nil { +// klog.Errorf("error listing global nodes: %v", err) +// return +// } + +// for _, globalNode := range globalNodeList.Items { +// if err := r.SyncNodeStatus(ctx, &globalNode); err != nil { +// klog.Errorf("error syncing node status for global node %s: %v", globalNode.Name, err) +// } +// } +// }, 10*time.Second) + +// <-ctx.Done() +// return nil +// } + +// func (r *GlobalNodeController) ChooseNode(ctx context.Context, globalNode *v1alpha1.GlobalNode) (*v1alpha1.GlobalNode, error) { + +// var updateGlobalNode *v1alpha1.GlobalNode +// // 如果节点状态是 "InUse" +// if globalNode.Spec.State == v1alpha1.NodeInUse { +// var virtualCluster v1alpha1.VirtualCluster +// if err := r.Get(ctx, types.NamespacedName{Name: globalNode.Name}, &virtualCluster); err != nil { +// klog.Errorf("global-node-controller: SyncNodeStatus: can not get target virtualCluster, err: %s", globalNode.Name) +// return nil, err +// } +// k8sClient, err := util.GenerateKubeclient(&virtualCluster) +// if err != nil { +// klog.Errorf("virtualcluster %s crd kubernetes client failed: %v", virtualCluster.Name, err) +// return nil, err +// } + +// virtualClusterNode, err := k8sClient.CoreV1().Nodes().Get(ctx, metav1.ListOptions{}) +// if err != nil { +// klog.Errorf("virtualcluster %s get virtual-cluster nodes failed: %v", virtualCluster.Name, err) +// return nil, err +// } + +// current, err := r.KosmosClient.KosmosV1alpha1().GlobalNodes().Get(context.TODO(), virtualClusterNode.Name, metav1.GetOptions{}) +// if err != nil { +// if apierrors.IsNotFound(err) { +// klog.Errorf("globalnode %s not found. This should not happen normally", virtualClusterNode.Name) +// return nil, klog.Errorf("globalNode %s not found", virtualClusterNode.Name) +// } +// klog.Errorf("failed to get globalNode %s: %v", virtualClusterNode.Name, err) +// return nil, err +// } +// // if the node is in use, we don't need to update the status, because the status is updated by the node controller. +// updateGlobalNode = current.DeepCopy() +// updateGlobalNode.Status.Conditions = virtualClusterNode.Status.Conditions +// // klog.V(4).Infof("global-node-controller: SyncState: node is in use %s, skip", globalNode.Name) +// // return nil +// } else { +// var targetNode v1.Node +// if err := r.Get(ctx, types.NamespacedName{Name: globalNode.Name}, &targetNode); err != nil { +// klog.Errorf("global-node-controller: SyncNodeStatus: can not get target node, err: %s", globalNode.Name) +// return nil, err +// } +// updateGlobalNode = globalNode.DeepCopy() +// updateGlobalNode.Status.Conditions = targetNode.Status.Conditions +// } +// return updateGlobalNode, nil +// } + +// 将node的状态上报给globalnode,对于 STATE为reserved和free的直接更新->global_node_controller +// occupied的需要获取vc的node信息再更新->node_controller +func (r *GlobalNodeController) SyncNodeStatus(ctx context.Context, globalNode *v1alpha1.GlobalNode) error { + + err := retry.RetryOnConflict(retry.DefaultRetry, func() error { + + //每次重试时重新获取最新的 globalNode + currentGlobalNode := &v1alpha1.GlobalNode{} + if err := r.Get(ctx, types.NamespacedName{Name: globalNode.Name}, currentGlobalNode); err != nil { + klog.Errorf("global-node-controller: SyncNodeStatus: failed to get globalNode %s, err: %v", globalNode.Name, err) + return err + } + + var updateGlobalNode *v1alpha1.GlobalNode + if globalNode.Spec.State == v1alpha1.NodeInUse { + var virtualCluster v1alpha1.VirtualCluster + if err := r.Get(ctx, types.NamespacedName{Name: globalNode.Name}, &virtualCluster); err != nil { + klog.Errorf("global-node-controller: SyncNodeStatus: can not get target virtualCluster, err: %s", globalNode.Name) + return err + } + k8sClient, err := util.GenerateKubeclient(&virtualCluster) + if err != nil { + klog.Errorf("virtualcluster %s crd kubernetes client failed: %v", virtualCluster.Name, err) + return err + } + virtualClusterNode, err := k8sClient.CoreV1().Nodes().Get(ctx, globalNode.Name, metav1.GetOptions{}) + if err != nil { + klog.Errorf("virtualcluster %s get virtual-cluster nodes failed: %v", virtualCluster.Name, err) + return err + } + current, err := r.KosmosClient.KosmosV1alpha1().GlobalNodes().Get(context.TODO(), virtualClusterNode.Name, metav1.GetOptions{}) + if err != nil { + if apierrors.IsNotFound(err) { + klog.Errorf("globalnode %s not found. This should not happen normally", virtualClusterNode.Name) + return nil + } + klog.Errorf("failed to get globalNode %s: %v", virtualClusterNode.Name, err) + return err + } + // if the node is in use, we don't need to update the status, because the status is updated by the node controller. + updateGlobalNode = current.DeepCopy() + updateGlobalNode.Status.Conditions = virtualClusterNode.Status.Conditions + // klog.V(4).Infof("global-node-controller: SyncState: node is in use %s, skip", globalNode.Name) + // return nil + } else { + var targetNode v1.Node + if err := r.Get(ctx, types.NamespacedName{Name: globalNode.Name}, &targetNode); err != nil { + klog.Errorf("global-node-controller: SyncNodeStatus: can not get target node, err: %s", globalNode.Name) + return err + } + //updateGlobalNode = globalNode.DeepCopy() + updateGlobalNode = currentGlobalNode.DeepCopy() + updateGlobalNode.Status.Conditions = targetNode.Status.Conditions + } + + if err := r.Status().Update(ctx, updateGlobalNode); err != nil { + //klog.Errorf("update node status for globalnode failed, err: %s", globalNode.Name) + klog.Errorf("update node %s status for globalnode failed, %v", globalNode.Name, err) + return err + } + klog.V(4).Infof("SyncNodeStatus: successfully updated global node %s, Status.Conditions: %+v", updateGlobalNode.Name, updateGlobalNode.Status.Conditions) + return nil + }) + + // err := retry.RetryOnConflict(retry.DefaultRetry, func() error { + // var targetNode v1.Node + // if err := r.Get(ctx, types.NamespacedName{Name: globalNode.Name}, &targetNode); err != nil { + // klog.Errorf("global-node-controller: SyncNodeStatus: can not get target node, err: %s", globalNode.Name) + // return err + // } + + // updateGlobalNode := globalNode.DeepCopy() + // updateGlobalNode.Status.Conditions = targetNode.Status.Conditions + + // if err := r.Status().Update(ctx, updateGlobalNode); err != nil { + // klog.Errorf("update node status for globalnode failed, err: %s", globalNode.Name) + // return err + // } + // klog.V(4).Infof("SyncNodeStatus: successfully updated global node %s, Status.Conditions: %+v", updateGlobalNode.Name, updateGlobalNode.Status.Conditions) + // // // 重新获取更新后的 GlobalNode,确保获取最新状态 + // rGlobalNode, err := r.KosmosClient.KosmosV1alpha1().GlobalNodes().Get(ctx, updateGlobalNode.Name, metav1.GetOptions{}) + // if err != nil { + // klog.Errorf("global-node-controller: SyncLabel: failed to get updated global node: %s, err: %s", updateGlobalNode.Name, err) + // return err + // } + // // 只打印更新后的 GlobalNode 的 Status 部分 + // klog.V(4).Infof("global-node-controller: SyncLabel: successfully updated global node %s, updated status: %+v", rGlobalNode.Name, rGlobalNode.Status) + // return nil + // }) + return err +} + func (r *GlobalNodeController) SyncTaint(ctx context.Context, globalNode *v1alpha1.GlobalNode) error { if globalNode.Spec.State == v1alpha1.NodeFreeState { err := retry.RetryOnConflict(retry.DefaultRetry, func() error { + //获得globalnode对应的node var targetNode v1.Node if err := r.Get(ctx, types.NamespacedName{Name: globalNode.Name}, &targetNode); err != nil { klog.Errorf("global-node-controller: SyncTaints: can not get host node, err: %s", globalNode.Name) @@ -215,6 +398,9 @@ func (r *GlobalNodeController) Reconcile(ctx context.Context, request reconcile. klog.V(4).Infof("============ global-node-controller start to reconcile %s ============", request.NamespacedName) defer klog.V(4).Infof("============ global-node-controller finish to reconcile %s ============", request.NamespacedName) + // r.syncNodeStatusMux.Lock() + // defer r.syncNodeStatusMux.Unlock() + var globalNode v1alpha1.GlobalNode if err := r.Get(ctx, request.NamespacedName, &globalNode); err != nil { if apierrors.IsNotFound(err) { @@ -263,6 +449,12 @@ func (r *GlobalNodeController) Reconcile(ctx context.Context, request reconcile. return reconcile.Result{RequeueAfter: utils.DefaultRequeueTime}, nil } + if err = r.SyncNodeStatus(ctx, &globalNode); err != nil { + klog.Warningf("sync status %s error: %v", request.NamespacedName, err) + return reconcile.Result{RequeueAfter: utils.DefaultRequeueTime}, nil + } + klog.V(4).Infof("sync status successed, %s", request.NamespacedName) + if err = r.SyncLabel(ctx, &globalNode); err != nil { klog.Warningf("sync label %s error: %v", request.NamespacedName, err) return reconcile.Result{RequeueAfter: utils.DefaultRequeueTime}, nil diff --git a/pkg/kubenest/controller/virtualcluster.node.controller/node_controller.go b/pkg/kubenest/controller/virtualcluster.node.controller/node_controller.go index 66ab8d65f..dc820a8c8 100644 --- a/pkg/kubenest/controller/virtualcluster.node.controller/node_controller.go +++ b/pkg/kubenest/controller/virtualcluster.node.controller/node_controller.go @@ -4,12 +4,14 @@ import ( "context" "fmt" "sync" + "time" "github.com/pkg/errors" v1 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" + "k8s.io/apimachinery/pkg/util/wait" "k8s.io/client-go/kubernetes" "k8s.io/client-go/tools/record" "k8s.io/client-go/util/retry" @@ -138,6 +140,7 @@ func (r *NodeController) compareAndTranformNodes(ctx context.Context, targetNode return unjoinNodes, joinNodes, nil } +// 对应kubectl describe vc sl0926 -n mop-t-24092636895715中的Status字段更新 func (r *NodeController) UpdateVirtualClusterStatus(ctx context.Context, virtualCluster v1alpha1.VirtualCluster, status v1alpha1.Phase, reason string) error { retryErr := retry.RetryOnConflict(retry.DefaultRetry, func() error { var targetObj v1alpha1.VirtualCluster @@ -166,6 +169,76 @@ func (r *NodeController) UpdateVirtualClusterStatus(ctx context.Context, virtual return nil } +func (r *NodeController) Start(ctx context.Context) error { + + go wait.UntilWithContext(ctx, func(ctx context.Context) { + // 这里可以获取需要同步的 globalNode 列表,逐个同步状态 + var virtualClusterList v1alpha1.VirtualClusterList + if err := r.List(ctx, &virtualClusterList); err != nil { + klog.Errorf("error listing global nodes: %v", err) + return + } + for _, virtualCluster := range virtualClusterList.Items { + if err := r.UpdateVirtualClusterGlobalNode(ctx, &virtualCluster); err != nil { + klog.Errorf("error syncing node status for global node %s: %v", virtualCluster.Name, err) + } + } + }, 10*time.Second) + + <-ctx.Done() + return nil +} + +// 从 VirtualCluster 实例中获取对应的节点信息并更新到globalnode中,但当VC清除时候,需要修改次数的逻辑 +func (r *NodeController) UpdateVirtualClusterGlobalNode(ctx context.Context, virtualCluster *v1alpha1.VirtualCluster) error { + retryErr := retry.RetryOnConflict(retry.DefaultRetry, func() error { + // var virtualCluster v1alpha1.VirtualCluster + // if err := r.Get(ctx, request.NamespacedName, &virtualCluster); err != nil { + // if apierrors.IsNotFound(err) { + // klog.V(4).Infof("virtual-cluster-node-controller: can not found %s", request.NamespacedName) + // return reconcile.Result{}, nil + // } + // klog.Errorf("get clusternode %s error: %v", request.NamespacedName, err) + k8sClient, err := util.GenerateKubeclient(virtualCluster) + if err != nil { + return fmt.Errorf("virtualcluster %s crd kubernetes client failed: %v", virtualCluster.Name, err) + } + + nodes, err := k8sClient.CoreV1().Nodes().List(ctx, metav1.ListOptions{}) + if err != nil { + return fmt.Errorf("virtualcluster %s get virtual-cluster nodes list failed: %v", virtualCluster.Name, err) + } + + for _, node := range nodes.Items { + current, err := r.KosmosClient.KosmosV1alpha1().GlobalNodes().Get(context.TODO(), node.Name, metav1.GetOptions{}) + if err != nil { + if apierrors.IsNotFound(err) { + klog.Errorf("globalnode %s not found. This should not happen normally", node.Name) + return nil + } + return fmt.Errorf("failed to get globalNode %s: %v", node.Name, err) + } + + updated := current.DeepCopy() + updated.Status.Conditions = node.Status.Conditions + + if err := r.Status().Update(ctx, updated); err != nil { + klog.Errorf("update node status for globalnode failed, err: %s", updated.Name) + return err + } + + klog.V(4).Infof("SyncNodeStatus: successfully updated global node %s, Status.Conditions: %+v", updated.Name, updated.Status.Conditions) + } + return nil + }) + + if retryErr != nil { + return fmt.Errorf("update virtualcluster %s status namespace %s failed: %s", virtualCluster.Name, virtualCluster.Namespace, retryErr) + } + + return nil +} + func (r *NodeController) DoNodeTask(ctx context.Context, virtualCluster v1alpha1.VirtualCluster) error { k8sClient, err := util.GenerateKubeclient(&virtualCluster) if err != nil { diff --git a/pkg/kubenest/controller/virtualcluster_init_controller.go b/pkg/kubenest/controller/virtualcluster_init_controller.go index 7c3545f38..9ab2fe694 100644 --- a/pkg/kubenest/controller/virtualcluster_init_controller.go +++ b/pkg/kubenest/controller/virtualcluster_init_controller.go @@ -527,13 +527,13 @@ func retrieveGlobalNodesWithLabelSelector(nodes []v1alpha1.GlobalNode, labelSele return matchedNodes, nil } +// 在此处对globalnode中的updateStatusFunc,但更新到globalnode只是VC的status?应该为VC中node的status func (c *VirtualClusterInitController) setGlobalNodeUsageStatus(virtualCluster *v1alpha1.VirtualCluster, node *v1alpha1.GlobalNode) error { updateSpecFunc := func() error { current, err := c.KosmosClient.KosmosV1alpha1().GlobalNodes().Get(context.TODO(), node.Name, metav1.GetOptions{}) if err != nil { if apierrors.IsNotFound(err) { klog.Errorf("globalnode %s not found. This should not happen normally", node.Name) - // 如果节点不存在,则不执行更新并返回nil return nil } return fmt.Errorf("failed to get globalNode %s: %v", node.Name, err) From 186b71c30953ccfe345b73600db03d7aa5f9b783 Mon Sep 17 00:00:00 2001 From: gaoyuan Date: Thu, 31 Oct 2024 16:03:00 +0800 Subject: [PATCH 3/5] update sync globalnode --- cmd/kubenest/operator/app/operator.go | 24 +-- .../controllers/node_lease_controller.go | 10 +- .../controllers/node_lease_controller_test.go | 59 ------- .../global_node_controller.go | 159 +----------------- .../node_controller.go | 73 -------- .../virtualcluster_init_controller.go | 1 - 6 files changed, 18 insertions(+), 308 deletions(-) delete mode 100644 pkg/clustertree/cluster-manager/controllers/node_lease_controller_test.go diff --git a/cmd/kubenest/operator/app/operator.go b/cmd/kubenest/operator/app/operator.go index 70dcbbe7b..35d38067c 100644 --- a/cmd/kubenest/operator/app/operator.go +++ b/cmd/kubenest/operator/app/operator.go @@ -218,11 +218,11 @@ func run(ctx context.Context, config *config.Config) error { } mgr, err := controllerruntime.NewManager(config.RestConfig, controllerruntime.Options{ - Logger: klog.Background(), - Scheme: newscheme, - // LeaderElection: config.LeaderElection.LeaderElect, - // LeaderElectionID: config.LeaderElection.ResourceName, - // LeaderElectionNamespace: config.LeaderElection.ResourceNamespace, + Logger: klog.Background(), + Scheme: newscheme, + LeaderElection: config.LeaderElection.LeaderElect, + LeaderElectionID: config.LeaderElection.ResourceName, + LeaderElectionNamespace: config.LeaderElection.ResourceNamespace, }) if err != nil { return fmt.Errorf("failed to build controller manager: %v", err) @@ -261,13 +261,6 @@ func run(ctx context.Context, config *config.Config) error { return fmt.Errorf("error starting %s: %v", constants.GlobalNodeControllerName, err) } - //启动 GlobalNodeController的定时同步 - // go func() { - // if err := GlobalNodeController.Start(ctx); err != nil { - // klog.Errorf("error starting GlobalNodeController: %v", err) - // } - // }() - if err := startEndPointsControllers(mgr); err != nil { return err } @@ -284,13 +277,6 @@ func run(ctx context.Context, config *config.Config) error { return fmt.Errorf("error starting %s: %v", constants.NodeControllerName, err) } - //启动 VirtualClusterNodeController的定时同步 - go func() { - if err := VirtualClusterNodeController.Start(ctx); err != nil { - klog.Errorf("error starting VirtualClusterNodeController: %v", err) - } - }() - if config.KubeNestOptions.KubeNestType == v1alpha1.KosmosKube { KosmosJoinController := kosmos.KosmosJoinController{ Client: mgr.GetClient(), diff --git a/pkg/clustertree/cluster-manager/controllers/node_lease_controller.go b/pkg/clustertree/cluster-manager/controllers/node_lease_controller.go index b5d66f9ed..53471e7dc 100644 --- a/pkg/clustertree/cluster-manager/controllers/node_lease_controller.go +++ b/pkg/clustertree/cluster-manager/controllers/node_lease_controller.go @@ -99,17 +99,21 @@ func (c *NodeLeaseController) updateNodeStatus(ctx context.Context, n []*corev1. } func (c *NodeLeaseController) syncpodStatus(ctx context.Context) { - err := c.updatepodStatus(ctx) + + pods, err := c.LeafModelHandler.GetLeafPods(ctx, rootNode, c.LeafNodeSelectors[rootNode.Name]) + if err != nil { - klog.Errorf(err.Error()) + klog.Errorf("Could not list pods in leaf cluster,Error: %v", err) } + + return nil } func (c *NodeLeaseController) updatepodStatus(ctx context.Context) error { - pods, err := c.leafClient.CoreV1().Pods(metav1.NamespaceAll).List(ctx, metav1.ListOptions{ LabelSelector: fmt.Sprintf("%s!=%s", utils.KosmosPodLabel, utils.KosmosNodeValue), }) + if err != nil { klog.Errorf("Could not list pods in leaf cluster,Error: %v", err) } diff --git a/pkg/clustertree/cluster-manager/controllers/node_lease_controller_test.go b/pkg/clustertree/cluster-manager/controllers/node_lease_controller_test.go deleted file mode 100644 index e4e75c3e3..000000000 --- a/pkg/clustertree/cluster-manager/controllers/node_lease_controller_test.go +++ /dev/null @@ -1,59 +0,0 @@ -package controllers - -import ( - "context" - "sync" - "testing" - "time" - - kosmosv1alpha1 "github.com/kosmos.io/kosmos/pkg/apis/kosmos/v1alpha1" - leafUtils "github.com/kosmos.io/kosmos/pkg/clustertree/cluster-manager/utils" - corev1 "k8s.io/api/core/v1" - "k8s.io/client-go/kubernetes" - "sigs.k8s.io/controller-runtime/pkg/client" -) - -func TestNodeLeaseController_updatepodStatus(t *testing.T) { - type fields struct { - leafClient kubernetes.Interface - rootClient kubernetes.Interface - root client.Client - LeafModelHandler leafUtils.LeafModelHandler - leaseInterval time.Duration - statusInterval time.Duration - podstatusInterval time.Duration - nodes []*corev1.Node - LeafNodeSelectors map[string]kosmosv1alpha1.NodeSelector - nodeLock sync.Mutex - } - type args struct { - ctx context.Context - } - tests := []struct { - name string - fields fields - args args - wantErr bool - }{ - // TODO: Add test cases. - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - c := &NodeLeaseController{ - leafClient: tt.fields.leafClient, - rootClient: tt.fields.rootClient, - root: tt.fields.root, - LeafModelHandler: tt.fields.LeafModelHandler, - leaseInterval: tt.fields.leaseInterval, - statusInterval: tt.fields.statusInterval, - podstatusInterval: tt.fields.podstatusInterval, - nodes: tt.fields.nodes, - LeafNodeSelectors: tt.fields.LeafNodeSelectors, - nodeLock: tt.fields.nodeLock, - } - if err := c.updatepodStatus(tt.args.ctx); (err != nil) != tt.wantErr { - t.Errorf("NodeLeaseController.updatepodStatus() error = %v, wantErr %v", err, tt.wantErr) - } - }) - } -} diff --git a/pkg/kubenest/controller/global.node.controller/global_node_controller.go b/pkg/kubenest/controller/global.node.controller/global_node_controller.go index 690a78799..6b0c6c9ab 100644 --- a/pkg/kubenest/controller/global.node.controller/global_node_controller.go +++ b/pkg/kubenest/controller/global.node.controller/global_node_controller.go @@ -115,115 +115,10 @@ func (r *GlobalNodeController) newVirtualClusterMapFunc() handler.MapFunc { } } -// func (r *GlobalNodeController) newNodeMapFunc() handler.MapFunc { -// return func(a client.Object) []reconcile.Request { -// var requests []reconcile.Request -// node := a.(*v1.Node) -// klog.V(4).Infof("global-node-controller: node change: %s", node.Name) -// requests = append(requests, reconcile.Request{NamespacedName: types.NamespacedName{ -// Name: node.Name, -// }}) -// return requests -// } -// } - -// func (r *GlobalNodeController) Start(ctx context.Context) error { -// // globalnodes := make([]*v1alpha1.GlobalNodeList, 0) -// // c.nodeLock.Lock() -// // for _, nodeIndex := range c.nodes { -// // nodeCopy := nodeIndex.DeepCopy() -// // nodes = append(nodes, nodeCopy) -// // } -// // c.nodeLock.Unlock() - -// // err := c.updateNodeStatus(ctx, nodes, c.LeafNodeSelectors) -// // if err != nil { -// // klog.Errorf(err.Error()) -// // } - -// go wait.UntilWithContext(ctx, func(ctx context.Context) { - -// r.syncNodeStatusMux.Lock() -// defer r.syncNodeStatusMux.Unlock() - -// var globalNodeList v1alpha1.GlobalNodeList -// if err := r.List(ctx, &globalNodeList); err != nil { -// klog.Errorf("error listing global nodes: %v", err) -// return -// } - -// for _, globalNode := range globalNodeList.Items { -// if err := r.SyncNodeStatus(ctx, &globalNode); err != nil { -// klog.Errorf("error syncing node status for global node %s: %v", globalNode.Name, err) -// } -// } -// }, 10*time.Second) - -// <-ctx.Done() -// return nil -// } - -// func (r *GlobalNodeController) ChooseNode(ctx context.Context, globalNode *v1alpha1.GlobalNode) (*v1alpha1.GlobalNode, error) { - -// var updateGlobalNode *v1alpha1.GlobalNode -// // 如果节点状态是 "InUse" -// if globalNode.Spec.State == v1alpha1.NodeInUse { -// var virtualCluster v1alpha1.VirtualCluster -// if err := r.Get(ctx, types.NamespacedName{Name: globalNode.Name}, &virtualCluster); err != nil { -// klog.Errorf("global-node-controller: SyncNodeStatus: can not get target virtualCluster, err: %s", globalNode.Name) -// return nil, err -// } -// k8sClient, err := util.GenerateKubeclient(&virtualCluster) -// if err != nil { -// klog.Errorf("virtualcluster %s crd kubernetes client failed: %v", virtualCluster.Name, err) -// return nil, err -// } - -// virtualClusterNode, err := k8sClient.CoreV1().Nodes().Get(ctx, metav1.ListOptions{}) -// if err != nil { -// klog.Errorf("virtualcluster %s get virtual-cluster nodes failed: %v", virtualCluster.Name, err) -// return nil, err -// } - -// current, err := r.KosmosClient.KosmosV1alpha1().GlobalNodes().Get(context.TODO(), virtualClusterNode.Name, metav1.GetOptions{}) -// if err != nil { -// if apierrors.IsNotFound(err) { -// klog.Errorf("globalnode %s not found. This should not happen normally", virtualClusterNode.Name) -// return nil, klog.Errorf("globalNode %s not found", virtualClusterNode.Name) -// } -// klog.Errorf("failed to get globalNode %s: %v", virtualClusterNode.Name, err) -// return nil, err -// } -// // if the node is in use, we don't need to update the status, because the status is updated by the node controller. -// updateGlobalNode = current.DeepCopy() -// updateGlobalNode.Status.Conditions = virtualClusterNode.Status.Conditions -// // klog.V(4).Infof("global-node-controller: SyncState: node is in use %s, skip", globalNode.Name) -// // return nil -// } else { -// var targetNode v1.Node -// if err := r.Get(ctx, types.NamespacedName{Name: globalNode.Name}, &targetNode); err != nil { -// klog.Errorf("global-node-controller: SyncNodeStatus: can not get target node, err: %s", globalNode.Name) -// return nil, err -// } -// updateGlobalNode = globalNode.DeepCopy() -// updateGlobalNode.Status.Conditions = targetNode.Status.Conditions -// } -// return updateGlobalNode, nil -// } - -// 将node的状态上报给globalnode,对于 STATE为reserved和free的直接更新->global_node_controller -// occupied的需要获取vc的node信息再更新->node_controller +// sync node status to globalnode,if STATE=="free" or "reserved",directly update +// else get virtualcluster kubeconfig and use its node to update func (r *GlobalNodeController) SyncNodeStatus(ctx context.Context, globalNode *v1alpha1.GlobalNode) error { - err := retry.RetryOnConflict(retry.DefaultRetry, func() error { - - //每次重试时重新获取最新的 globalNode - currentGlobalNode := &v1alpha1.GlobalNode{} - if err := r.Get(ctx, types.NamespacedName{Name: globalNode.Name}, currentGlobalNode); err != nil { - klog.Errorf("global-node-controller: SyncNodeStatus: failed to get globalNode %s, err: %v", globalNode.Name, err) - return err - } - var updateGlobalNode *v1alpha1.GlobalNode if globalNode.Spec.State == v1alpha1.NodeInUse { var virtualCluster v1alpha1.VirtualCluster @@ -241,72 +136,30 @@ func (r *GlobalNodeController) SyncNodeStatus(ctx context.Context, globalNode *v klog.Errorf("virtualcluster %s get virtual-cluster nodes failed: %v", virtualCluster.Name, err) return err } - current, err := r.KosmosClient.KosmosV1alpha1().GlobalNodes().Get(context.TODO(), virtualClusterNode.Name, metav1.GetOptions{}) - if err != nil { - if apierrors.IsNotFound(err) { - klog.Errorf("globalnode %s not found. This should not happen normally", virtualClusterNode.Name) - return nil - } - klog.Errorf("failed to get globalNode %s: %v", virtualClusterNode.Name, err) - return err - } - // if the node is in use, we don't need to update the status, because the status is updated by the node controller. - updateGlobalNode = current.DeepCopy() + updateGlobalNode = globalNode.DeepCopy() updateGlobalNode.Status.Conditions = virtualClusterNode.Status.Conditions - // klog.V(4).Infof("global-node-controller: SyncState: node is in use %s, skip", globalNode.Name) - // return nil } else { var targetNode v1.Node if err := r.Get(ctx, types.NamespacedName{Name: globalNode.Name}, &targetNode); err != nil { klog.Errorf("global-node-controller: SyncNodeStatus: can not get target node, err: %s", globalNode.Name) return err } - //updateGlobalNode = globalNode.DeepCopy() - updateGlobalNode = currentGlobalNode.DeepCopy() + updateGlobalNode = globalNode.DeepCopy() updateGlobalNode.Status.Conditions = targetNode.Status.Conditions } - - if err := r.Status().Update(ctx, updateGlobalNode); err != nil { - //klog.Errorf("update node status for globalnode failed, err: %s", globalNode.Name) + if _, err := r.KosmosClient.KosmosV1alpha1().GlobalNodes().UpdateStatus(ctx, updateGlobalNode, metav1.UpdateOptions{}); err != nil { klog.Errorf("update node %s status for globalnode failed, %v", globalNode.Name, err) return err } - klog.V(4).Infof("SyncNodeStatus: successfully updated global node %s, Status.Conditions: %+v", updateGlobalNode.Name, updateGlobalNode.Status.Conditions) + klog.V(4).Infof("global-node-controller: syncNodeStatus: successfully updated global node %s", updateGlobalNode.Name) return nil }) - - // err := retry.RetryOnConflict(retry.DefaultRetry, func() error { - // var targetNode v1.Node - // if err := r.Get(ctx, types.NamespacedName{Name: globalNode.Name}, &targetNode); err != nil { - // klog.Errorf("global-node-controller: SyncNodeStatus: can not get target node, err: %s", globalNode.Name) - // return err - // } - - // updateGlobalNode := globalNode.DeepCopy() - // updateGlobalNode.Status.Conditions = targetNode.Status.Conditions - - // if err := r.Status().Update(ctx, updateGlobalNode); err != nil { - // klog.Errorf("update node status for globalnode failed, err: %s", globalNode.Name) - // return err - // } - // klog.V(4).Infof("SyncNodeStatus: successfully updated global node %s, Status.Conditions: %+v", updateGlobalNode.Name, updateGlobalNode.Status.Conditions) - // // // 重新获取更新后的 GlobalNode,确保获取最新状态 - // rGlobalNode, err := r.KosmosClient.KosmosV1alpha1().GlobalNodes().Get(ctx, updateGlobalNode.Name, metav1.GetOptions{}) - // if err != nil { - // klog.Errorf("global-node-controller: SyncLabel: failed to get updated global node: %s, err: %s", updateGlobalNode.Name, err) - // return err - // } - // // 只打印更新后的 GlobalNode 的 Status 部分 - // klog.V(4).Infof("global-node-controller: SyncLabel: successfully updated global node %s, updated status: %+v", rGlobalNode.Name, rGlobalNode.Status) - // return nil - // }) return err } func (r *GlobalNodeController) SyncTaint(ctx context.Context, globalNode *v1alpha1.GlobalNode) error { if globalNode.Spec.State == v1alpha1.NodeFreeState { err := retry.RetryOnConflict(retry.DefaultRetry, func() error { - //获得globalnode对应的node var targetNode v1.Node if err := r.Get(ctx, types.NamespacedName{Name: globalNode.Name}, &targetNode); err != nil { klog.Errorf("global-node-controller: SyncTaints: can not get host node, err: %s", globalNode.Name) diff --git a/pkg/kubenest/controller/virtualcluster.node.controller/node_controller.go b/pkg/kubenest/controller/virtualcluster.node.controller/node_controller.go index dc820a8c8..66ab8d65f 100644 --- a/pkg/kubenest/controller/virtualcluster.node.controller/node_controller.go +++ b/pkg/kubenest/controller/virtualcluster.node.controller/node_controller.go @@ -4,14 +4,12 @@ import ( "context" "fmt" "sync" - "time" "github.com/pkg/errors" v1 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/util/wait" "k8s.io/client-go/kubernetes" "k8s.io/client-go/tools/record" "k8s.io/client-go/util/retry" @@ -140,7 +138,6 @@ func (r *NodeController) compareAndTranformNodes(ctx context.Context, targetNode return unjoinNodes, joinNodes, nil } -// 对应kubectl describe vc sl0926 -n mop-t-24092636895715中的Status字段更新 func (r *NodeController) UpdateVirtualClusterStatus(ctx context.Context, virtualCluster v1alpha1.VirtualCluster, status v1alpha1.Phase, reason string) error { retryErr := retry.RetryOnConflict(retry.DefaultRetry, func() error { var targetObj v1alpha1.VirtualCluster @@ -169,76 +166,6 @@ func (r *NodeController) UpdateVirtualClusterStatus(ctx context.Context, virtual return nil } -func (r *NodeController) Start(ctx context.Context) error { - - go wait.UntilWithContext(ctx, func(ctx context.Context) { - // 这里可以获取需要同步的 globalNode 列表,逐个同步状态 - var virtualClusterList v1alpha1.VirtualClusterList - if err := r.List(ctx, &virtualClusterList); err != nil { - klog.Errorf("error listing global nodes: %v", err) - return - } - for _, virtualCluster := range virtualClusterList.Items { - if err := r.UpdateVirtualClusterGlobalNode(ctx, &virtualCluster); err != nil { - klog.Errorf("error syncing node status for global node %s: %v", virtualCluster.Name, err) - } - } - }, 10*time.Second) - - <-ctx.Done() - return nil -} - -// 从 VirtualCluster 实例中获取对应的节点信息并更新到globalnode中,但当VC清除时候,需要修改次数的逻辑 -func (r *NodeController) UpdateVirtualClusterGlobalNode(ctx context.Context, virtualCluster *v1alpha1.VirtualCluster) error { - retryErr := retry.RetryOnConflict(retry.DefaultRetry, func() error { - // var virtualCluster v1alpha1.VirtualCluster - // if err := r.Get(ctx, request.NamespacedName, &virtualCluster); err != nil { - // if apierrors.IsNotFound(err) { - // klog.V(4).Infof("virtual-cluster-node-controller: can not found %s", request.NamespacedName) - // return reconcile.Result{}, nil - // } - // klog.Errorf("get clusternode %s error: %v", request.NamespacedName, err) - k8sClient, err := util.GenerateKubeclient(virtualCluster) - if err != nil { - return fmt.Errorf("virtualcluster %s crd kubernetes client failed: %v", virtualCluster.Name, err) - } - - nodes, err := k8sClient.CoreV1().Nodes().List(ctx, metav1.ListOptions{}) - if err != nil { - return fmt.Errorf("virtualcluster %s get virtual-cluster nodes list failed: %v", virtualCluster.Name, err) - } - - for _, node := range nodes.Items { - current, err := r.KosmosClient.KosmosV1alpha1().GlobalNodes().Get(context.TODO(), node.Name, metav1.GetOptions{}) - if err != nil { - if apierrors.IsNotFound(err) { - klog.Errorf("globalnode %s not found. This should not happen normally", node.Name) - return nil - } - return fmt.Errorf("failed to get globalNode %s: %v", node.Name, err) - } - - updated := current.DeepCopy() - updated.Status.Conditions = node.Status.Conditions - - if err := r.Status().Update(ctx, updated); err != nil { - klog.Errorf("update node status for globalnode failed, err: %s", updated.Name) - return err - } - - klog.V(4).Infof("SyncNodeStatus: successfully updated global node %s, Status.Conditions: %+v", updated.Name, updated.Status.Conditions) - } - return nil - }) - - if retryErr != nil { - return fmt.Errorf("update virtualcluster %s status namespace %s failed: %s", virtualCluster.Name, virtualCluster.Namespace, retryErr) - } - - return nil -} - func (r *NodeController) DoNodeTask(ctx context.Context, virtualCluster v1alpha1.VirtualCluster) error { k8sClient, err := util.GenerateKubeclient(&virtualCluster) if err != nil { diff --git a/pkg/kubenest/controller/virtualcluster_init_controller.go b/pkg/kubenest/controller/virtualcluster_init_controller.go index 9ab2fe694..ca7cb47da 100644 --- a/pkg/kubenest/controller/virtualcluster_init_controller.go +++ b/pkg/kubenest/controller/virtualcluster_init_controller.go @@ -527,7 +527,6 @@ func retrieveGlobalNodesWithLabelSelector(nodes []v1alpha1.GlobalNode, labelSele return matchedNodes, nil } -// 在此处对globalnode中的updateStatusFunc,但更新到globalnode只是VC的status?应该为VC中node的status func (c *VirtualClusterInitController) setGlobalNodeUsageStatus(virtualCluster *v1alpha1.VirtualCluster, node *v1alpha1.GlobalNode) error { updateSpecFunc := func() error { current, err := c.KosmosClient.KosmosV1alpha1().GlobalNodes().Get(context.TODO(), node.Name, metav1.GetOptions{}) From 6db7e7bc1f38ab27302a0131b4cb664eba6fddaa Mon Sep 17 00:00:00 2001 From: gaoyuan Date: Thu, 31 Oct 2024 18:03:13 +0800 Subject: [PATCH 4/5] update syncpodstatus --- .../controllers/node_lease_controller.go | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/pkg/clustertree/cluster-manager/controllers/node_lease_controller.go b/pkg/clustertree/cluster-manager/controllers/node_lease_controller.go index b5d66f9ed..dd0322288 100644 --- a/pkg/clustertree/cluster-manager/controllers/node_lease_controller.go +++ b/pkg/clustertree/cluster-manager/controllers/node_lease_controller.go @@ -2,7 +2,6 @@ package controllers import ( "context" - "fmt" "reflect" "sync" "time" @@ -21,7 +20,6 @@ import ( kosmosv1alpha1 "github.com/kosmos.io/kosmos/pkg/apis/kosmos/v1alpha1" leafUtils "github.com/kosmos.io/kosmos/pkg/clustertree/cluster-manager/utils" - "github.com/kosmos.io/kosmos/pkg/utils" "github.com/kosmos.io/kosmos/pkg/utils/podutils" "github.com/pkg/errors" ) @@ -90,6 +88,7 @@ func (c *NodeLeaseController) syncNodeStatus(ctx context.Context) { } // nolint + func (c *NodeLeaseController) updateNodeStatus(ctx context.Context, n []*corev1.Node, leafNodeSelector map[string]kosmosv1alpha1.NodeSelector) error { err := c.LeafModelHandler.UpdateRootNodeStatus(ctx, n, leafNodeSelector) if err != nil { @@ -106,14 +105,10 @@ func (c *NodeLeaseController) syncpodStatus(ctx context.Context) { } func (c *NodeLeaseController) updatepodStatus(ctx context.Context) error { - - pods, err := c.leafClient.CoreV1().Pods(metav1.NamespaceAll).List(ctx, metav1.ListOptions{ - LabelSelector: fmt.Sprintf("%s!=%s", utils.KosmosPodLabel, utils.KosmosNodeValue), - }) + pods, err := c.leafClient.CoreV1().Pods(metav1.NamespaceAll).List(ctx, metav1.ListOptions{}) if err != nil { klog.Errorf("Could not list pods in leaf cluster,Error: %v", err) } - var wg sync.WaitGroup for _, leafpod := range pods.Items { wg.Add(1) @@ -126,14 +121,11 @@ func (c *NodeLeaseController) updatepodStatus(ctx context.Context) error { klog.Warningf("Pod %s in namespace %s not found in root cluster, skipping...", leafpod.Name, leafpod.Namespace) return nil } - //klog.Warningf("Could not get pod in root cluster, Error: %v", err) return err } if podutils.IsKosmosPod(rootpod) && !reflect.DeepEqual(rootpod.Status, leafpod.Status) { rPodCopy := rootpod.DeepCopy() rPodCopy.Status = leafpod.Status - //klog.Errorf("leafpod Status.Conditions in root:%+v", leafpod.Status.Conditions) - //klog.Errorf("rPodCopy  status.Conditions after in root:%+v", rPodCopy.Status.Conditions) podutils.FitObjectMeta(&rPodCopy.ObjectMeta) if err := c.root.Status().Update(ctx, rPodCopy); err != nil && !apierrors.IsNotFound(err) { klog.V(4).Info(errors.Wrap(err, "error while updating pod status in kubernetes")) @@ -142,9 +134,8 @@ func (c *NodeLeaseController) updatepodStatus(ctx context.Context) error { } return nil }) - if err != nil { - klog.Errorf("Failed to update pod %s/%s, error: %v", leafpod.Namespace, leafpod.Name, err) + klog.Errorf("failed to update pod %s/%s, error: %v", leafpod.Namespace, leafpod.Name, err) } }(leafpod) } From 39d44e1822ec07510ab437e5b3d2016b25d1ed24 Mon Sep 17 00:00:00 2001 From: gaoyuan Date: Thu, 31 Oct 2024 19:14:05 +0800 Subject: [PATCH 5/5] sync pod status from leaf to root and sync node status to globalnode --- .../cluster-manager/controllers/node_lease_controller.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/clustertree/cluster-manager/controllers/node_lease_controller.go b/pkg/clustertree/cluster-manager/controllers/node_lease_controller.go index 591550217..aee4b2ff8 100644 --- a/pkg/clustertree/cluster-manager/controllers/node_lease_controller.go +++ b/pkg/clustertree/cluster-manager/controllers/node_lease_controller.go @@ -97,7 +97,7 @@ func (c *NodeLeaseController) updateNodeStatus(ctx context.Context, n []*corev1. return nil } -func (c *NodeLeaseController) syncpodStatus(ctx context.Context) { +func (c *NodeLeaseController) syncpodStatus(ctx context.Context) error { err := c.updatepodStatus(ctx) if err != nil { klog.Errorf("Could not update pod status in root cluster,Error: %v", err)