diff --git a/api/client/examples/resourceclaim/go.mod b/api/client/examples/resourceclaim/go.mod new file mode 100644 index 0000000000..613056a477 --- /dev/null +++ b/api/client/examples/resourceclaim/go.mod @@ -0,0 +1,63 @@ +module github.com/deckhouse/virtualization/api/client/examples/resourceclaim + +go 1.24.7 + +require ( + github.com/deckhouse/virtualization/api v1.0.0 + github.com/spf13/cobra v1.10.1 + github.com/spf13/pflag v1.0.10 +) + +require ( + github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect + github.com/emicklei/go-restful/v3 v3.11.0 // indirect + github.com/fxamacker/cbor/v2 v2.7.0 // indirect + github.com/go-logr/logr v1.4.2 // indirect + github.com/go-openapi/jsonpointer v0.21.0 // indirect + github.com/go-openapi/jsonreference v0.20.2 // indirect + github.com/go-openapi/swag v0.23.0 // indirect + github.com/gogo/protobuf v1.3.2 // indirect + github.com/google/gnostic-models v0.7.0 // indirect + github.com/google/go-cmp v0.7.0 // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 // indirect + github.com/inconshreveable/mousetrap v1.1.0 // indirect + github.com/josharian/intern v1.0.0 // indirect + github.com/json-iterator/go v1.1.12 // indirect + github.com/mailru/easyjson v0.7.7 // indirect + github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect + github.com/modern-go/reflect2 v1.0.2 // indirect + github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect + github.com/openshift/custom-resource-status v1.1.2 // indirect + github.com/pkg/errors v0.9.1 // indirect + github.com/x448/float16 v0.8.4 // indirect + go.yaml.in/yaml/v2 v2.4.2 // indirect + go.yaml.in/yaml/v3 v3.0.3 // indirect + golang.org/x/net v0.39.0 // indirect + golang.org/x/oauth2 v0.27.0 // indirect + golang.org/x/sys v0.32.0 // indirect + golang.org/x/term v0.31.0 // indirect + golang.org/x/text v0.24.0 // indirect + golang.org/x/time v0.9.0 // indirect + google.golang.org/protobuf v1.36.5 // indirect + gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect + gopkg.in/inf.v0 v0.9.1 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect + k8s.io/api v0.33.3 // indirect + k8s.io/apiextensions-apiserver v0.33.3 // indirect + k8s.io/apimachinery v0.33.3 // indirect + k8s.io/client-go v0.33.3 // indirect + k8s.io/klog/v2 v2.130.1 // indirect + k8s.io/kube-openapi v0.0.0-20250701173324-9bd5c66d9911 // indirect + k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738 // indirect + kubevirt.io/api v1.6.2 // indirect + kubevirt.io/containerized-data-importer-api v1.60.3-0.20241105012228-50fbed985de9 // indirect + kubevirt.io/controller-lifecycle-operator-sdk/api v0.0.0-20220329064328-f3cc58c6ed90 // indirect + sigs.k8s.io/controller-runtime v0.21.0 // indirect + sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3 // indirect + sigs.k8s.io/randfill v1.0.0 // indirect + sigs.k8s.io/structured-merge-diff/v4 v4.6.0 // indirect + sigs.k8s.io/yaml v1.4.0 // indirect +) + +replace github.com/deckhouse/virtualization/api => ./../../../../api diff --git a/api/client/examples/resourceclaim/go.sum b/api/client/examples/resourceclaim/go.sum new file mode 100644 index 0000000000..ed5c54dad5 --- /dev/null +++ b/api/client/examples/resourceclaim/go.sum @@ -0,0 +1,392 @@ +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= +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/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= +github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= +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.15.0+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= +github.com/emicklei/go-restful/v3 v3.11.0 h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxERmMY4rD+g= +github.com/emicklei/go-restful/v3 v3.11.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/evanphx/json-patch v4.12.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= +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/fxamacker/cbor/v2 v2.7.0 h1:iM5WgngdRBanHcxugY4JySA0nk1wZorNOpTgCMedv5E= +github.com/fxamacker/cbor/v2 v2.7.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ= +github.com/getkin/kin-openapi v0.76.0/go.mod h1:660oXbgy5JFMKreazJaQTw7o+X00qeSyhcnluiMv+Xg= +github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= +github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= +github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= +github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +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/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs= +github.com/go-openapi/jsonpointer v0.21.0 h1:YgdVicSA9vH5RiHs9TZW5oyafXZFc6+2Vc1rr/O9oNQ= +github.com/go-openapi/jsonpointer v0.21.0/go.mod h1:IUyH9l/+uyhIYQ/PXVA41Rexl+kOkAPDdXEYns6fzUY= +github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8= +github.com/go-openapi/jsonreference v0.19.5/go.mod h1:RdybgQwPxbL4UEjuAruzK1x3nE69AqPYEJeo/TWfEeg= +github.com/go-openapi/jsonreference v0.19.6/go.mod h1:diGHMEHg2IqXZGKxqyvWdfWU/aim5Dprw5bqpKkTvns= +github.com/go-openapi/jsonreference v0.20.2 h1:3sVjiK66+uXK/6oQ8xgcRKcFgQ5KXa2KvnJRumpMGbE= +github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k= +github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= +github.com/go-openapi/swag v0.19.14/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= +github.com/go-openapi/swag v0.21.1/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= +github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= +github.com/go-openapi/swag v0.23.0 h1:vsEVJDUo2hPJ2tu0/Xc+4noaxyEffXNIs3cOULZ+GrE= +github.com/go-openapi/swag v0.23.0/go.mod h1:esZ8ITTYEsH1V2trKHjAN8Ai7xHb8RV+YSZ577vPjgQ= +github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 h1:p104kn46Q8WdvHunIJ9dAyjPVtrBPhSr3KT2yUst43I= +github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= +github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= +github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= +github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= +github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/google/gnostic-models v0.7.0 h1:qwTtogB15McXDaNqTZdzPJRHvaVJlAl+HVQnLmJEJxo= +github.com/google/gnostic-models v0.7.0/go.mod h1:whL5G0m6dmc5cPxKc5bdKdEN3UjI7OUGxBlw57miDrQ= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= +github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= +github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20241210010833-40e02aabc2ad h1:a6HEuzUHeKH6hwfN/ZoQgRgVIWFJljSWa/zetS2WTvg= +github.com/google/pprof v0.0.0-20241210010833-40e02aabc2ad/go.mod h1:vavhavw2zAxS5dIdcRluK6cSGGPlZynqzFM8NdvU144= +github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/googleapis/gnostic v0.5.1/go.mod h1:6U4PtQXGIEt/Z3h5MAT7FNofLnw9vXk2cUuW7uA/OeU= +github.com/googleapis/gnostic v0.5.5/go.mod h1:7+EbHbldMins07ALC74bsA81Ovc97DwqyJO1AENw9kA= +github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= +github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 h1:JeSE6pjso5THxAzdVpqr6/geYxZytqFMBCOtn/ujyeo= +github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674/go.mod h1:r4w70xmWCQKmi1ONH4KIaBptdivuRPyosB9RmPlGEwA= +github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= +github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= +github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= +github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= +github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= +github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= +github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +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= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= +github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= +github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= +github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/moby/spdystream v0.2.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0GqbN2Wy8c= +github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= +github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= +github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= +github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= +github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= +github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= +github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= +github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= +github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= +github.com/onsi/ginkgo v1.16.4 h1:29JGrr5oVBm5ulCWet69zQkzWipVXIol6ygQUe/EzNc= +github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= +github.com/onsi/ginkgo/v2 v2.0.0/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= +github.com/onsi/ginkgo/v2 v2.23.3 h1:edHxnszytJ4lD9D5Jjc4tiDkPBZ3siDeJJkUZJJVkp0= +github.com/onsi/ginkgo/v2 v2.23.3/go.mod h1:zXTP6xIp3U8aVuXN8ENK9IXRaTjFnpVB9mGmaSRvxnM= +github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= +github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= +github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= +github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= +github.com/onsi/gomega v1.18.1/go.mod h1:0q+aL8jAiMXy9hbwj2mr5GziHiwhAIQpFmmtT5hitRs= +github.com/onsi/gomega v1.37.0 h1:CdEG8g0S133B4OswTDC/5XPSzE1OeP29QOioj2PID2Y= +github.com/onsi/gomega v1.37.0/go.mod h1:8D9+Txp43QWKhM24yyOBEdpkzN8FvJyAwecBgsU4KU0= +github.com/openshift/custom-resource-status v1.1.2 h1:C3DL44LEbvlbItfd8mT5jWrqPfHnSOQoQf/sypqA6A4= +github.com/openshift/custom-resource-status v1.1.2/go.mod h1:DB/Mf2oTeiAmVVX1gN+NEqweonAPY0TKUwADizj8+ZA= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= +github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= +github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= +github.com/spf13/cobra v1.10.1 h1:lJeBwCfmrnXthfAupyUTzJ/J4Nc1RsHC/mSRU2dll/s= +github.com/spf13/cobra v1.10.1/go.mod h1:7SmJGaTHFVBY0jW4NXGluQoLvhqFQM+6XSKD+P4XaB0= +github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/spf13/pflag v1.0.9/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/spf13/pflag v1.0.10 h1:4EBh2KAYBwaONj6b2Ye1GiHfwjqyROoF4RwYO+vPwFk= +github.com/spf13/pflag v1.0.10/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +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 v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= +github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +github.com/yuin/goldmark v1.4.0/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +go.yaml.in/yaml/v2 v2.4.2 h1:DzmwEr2rDGHl7lsFgAHxmNz/1NlQ7xLIrlN2h5d1eGI= +go.yaml.in/yaml/v2 v2.4.2/go.mod h1:081UH+NErpNdqlCXm3TtEran0rJZGxAYx9hb/ELlsPU= +go.yaml.in/yaml/v3 v3.0.3 h1:bXOww4E/J3f66rav3pX3m8w6jDE4knZjGOw8b5Y6iNE= +go.yaml.in/yaml/v3 v3.0.3/go.mod h1:tBHosrYAkRZjRAOREWbDnBXUf08JOwYq++0QNwQiWzI= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= +golang.org/x/net v0.0.0-20210421230115-4e50805a0758/go.mod h1:72T/g9IO56b78aLF+1Kcs5dz7/ng1VjMUvfKvpfy+jM= +golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= +golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211209124913-491a49abca63/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.39.0 h1:ZCu7HMWDxpXpaiKdhzIfaltL9Lp31x/3fCP11bc6/fY= +golang.org/x/net v0.39.0/go.mod h1:X7NRbYVEA+ewNkCNyJ513WmMdQ3BineSwVtN2zD/d+E= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.27.0 h1:da9Vo7/tDv5RH/7nZDz1eMGS/q1Vv1N/7FCrBhI9I3M= +golang.org/x/oauth2 v0.27.0/go.mod h1:onh5ek6nERTohokkhCD/y2cV4Do3fxFHFuAejCkRWT8= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210420072515-93ed5bcd2bfe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210831042530-f4d43177bf5e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.32.0 h1:s77OFDvIQeibCmezSnk/q6iAfkdiQaJi4VzroCFrN20= +golang.org/x/sys v0.32.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.31.0 h1:erwDkOK1Msy6offm1mOgvspSkslFnIGsFnxOKoufg3o= +golang.org/x/term v0.31.0/go.mod h1:R4BeIy7D95HzImkxGkTW1UQTtP54tio2RyHz7PwK0aw= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.24.0 h1:dd5Bzh4yt5KYA8f9CJHCP4FB4D51c2c6JvN37xJJkJ0= +golang.org/x/text v0.24.0/go.mod h1:L8rBsPeo2pSS+xqN0d5u2ikmjtmoJbDBT1b7nHvFCdU= +golang.org/x/time v0.9.0 h1:EsRrnYcQiGH+5FfbgvV4AP7qEZstoyrHB0DzarOQ4ZY= +golang.org/x/time v0.9.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20200505023115-26f46d2f7ef8/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.6-0.20210820212750-d4cc65f0b2ff/go.mod h1:YD9qOF0M9xpSpdWTBbzEl5e/RnCefISl8E5Noe10jFM= +golang.org/x/tools v0.1.9/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU= +golang.org/x/tools v0.32.0 h1:Q7N1vhpkQv7ybVzLFtTjvQya2ewbwNDZzUgfXGqtMWU= +golang.org/x/tools v0.32.0/go.mod h1:ZxrU41P/wAbZD8EDa6dDCa6XfpkhJ7HFMjHJXfBDu8s= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/genproto v0.0.0-20201019141844-1ed22bb0c154/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.36.5 h1:tPhr+woSbjfYvY6/GPufUoYizxw1cF/yFoxJ2fmpwlM= +google.golang.org/protobuf v1.36.5/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/evanphx/json-patch.v4 v4.12.0 h1:n6jtcsulIzXPJaxegRbvFNNrZDjbij7ny3gmSPG+6V4= +gopkg.in/evanphx/json-patch.v4 v4.12.0/go.mod h1:p8EYWUEYMpynmqDbY58zCKCFZw8pRWMG4EsWvDvM72M= +gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= +gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +k8s.io/api v0.23.3/go.mod h1:w258XdGyvCmnBj/vGzQMj6kzdufJZVUwEM1U2fRJwSQ= +k8s.io/api v0.33.3 h1:SRd5t//hhkI1buzxb288fy2xvjubstenEKL9K51KBI8= +k8s.io/api v0.33.3/go.mod h1:01Y/iLUjNBM3TAvypct7DIj0M0NIZc+PzAHCIo0CYGE= +k8s.io/apiextensions-apiserver v0.33.3 h1:qmOcAHN6DjfD0v9kxL5udB27SRP6SG/MTopmge3MwEs= +k8s.io/apiextensions-apiserver v0.33.3/go.mod h1:oROuctgo27mUsyp9+Obahos6CWcMISSAPzQ77CAQGz8= +k8s.io/apimachinery v0.23.3/go.mod h1:BEuFMMBaIbcOqVIJqNZJXGFTP4W6AycEpb5+m/97hrM= +k8s.io/apimachinery v0.33.3 h1:4ZSrmNa0c/ZpZJhAgRdcsFcZOw1PQU1bALVQ0B3I5LA= +k8s.io/apimachinery v0.33.3/go.mod h1:BHW0YOu7n22fFv/JkYOEfkUYNRN0fj0BlvMFWA7b+SM= +k8s.io/client-go v0.33.3 h1:M5AfDnKfYmVJif92ngN532gFqakcGi6RvaOF16efrpA= +k8s.io/client-go v0.33.3/go.mod h1:luqKBQggEf3shbxHY4uVENAxrDISLOarxpTKMiUuujg= +k8s.io/code-generator v0.23.3/go.mod h1:S0Q1JVA+kSzTI1oUvbKAxZY/DYbA/ZUb4Uknog12ETk= +k8s.io/gengo v0.0.0-20210813121822-485abfe95c7c/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= +k8s.io/gengo v0.0.0-20211129171323-c02415ce4185/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= +k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= +k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= +k8s.io/klog/v2 v2.30.0/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= +k8s.io/klog/v2 v2.40.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= +k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= +k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= +k8s.io/kube-openapi v0.0.0-20211115234752-e816edb12b65/go.mod h1:sX9MT8g7NVZM5lVL/j8QyCCJe8YSMW30QvGZWaCIDIk= +k8s.io/kube-openapi v0.0.0-20220124234850-424119656bbf/go.mod h1:sX9MT8g7NVZM5lVL/j8QyCCJe8YSMW30QvGZWaCIDIk= +k8s.io/kube-openapi v0.0.0-20250701173324-9bd5c66d9911 h1:gAXU86Fmbr/ktY17lkHwSjw5aoThQvhnstGGIYKlKYc= +k8s.io/kube-openapi v0.0.0-20250701173324-9bd5c66d9911/go.mod h1:GLOk5B+hDbRROvt0X2+hqX64v/zO3vXN7J78OUmBSKw= +k8s.io/utils v0.0.0-20210802155522-efc7438f0176/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= +k8s.io/utils v0.0.0-20211116205334-6203023598ed/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= +k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738 h1:M3sRQVHv7vB20Xc2ybTt7ODCeFj6JSWYFzOFnYeS6Ro= +k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= +kubevirt.io/api v1.6.2 h1:aoqZ4KsbOyDjLnuDw7H9wEgE/YTd/q5BBmYeQjJNizc= +kubevirt.io/api v1.6.2/go.mod h1:p66fEy/g79x7VpgUwrkUgOoG2lYs5LQq37WM6JXMwj4= +kubevirt.io/containerized-data-importer-api v1.60.3-0.20241105012228-50fbed985de9 h1:KTb8wO1Lxj220DX7d2Rdo9xovvlyWWNo3AVm2ua+1nY= +kubevirt.io/containerized-data-importer-api v1.60.3-0.20241105012228-50fbed985de9/go.mod h1:SDJjLGhbPyayDqAqawcGmVNapBp0KodOQvhKPLVGCQU= +kubevirt.io/controller-lifecycle-operator-sdk/api v0.0.0-20220329064328-f3cc58c6ed90 h1:QMrd0nKP0BGbnxTqakhDZAUhGKxPiPiN5gSDqKUmGGc= +kubevirt.io/controller-lifecycle-operator-sdk/api v0.0.0-20220329064328-f3cc58c6ed90/go.mod h1:018lASpFYBsYN6XwmA2TIrPCx6e0gviTd/ZNtSitKgc= +sigs.k8s.io/controller-runtime v0.21.0 h1:CYfjpEuicjUecRk+KAeyYh+ouUBn4llGyDYytIGcJS8= +sigs.k8s.io/controller-runtime v0.21.0/go.mod h1:OSg14+F65eWqIu4DceX7k/+QRAbTTvxeQSNSOQpukWM= +sigs.k8s.io/json v0.0.0-20211020170558-c049b76a60c6/go.mod h1:p4QtZmO4uMYipTQNzagwnNoseA6OxSUutVw05NhYDRs= +sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3 h1:/Rv+M11QRah1itp8VhT6HoVx1Ray9eB4DBr+K+/sCJ8= +sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3/go.mod h1:18nIHnGi6636UCz6m8i4DhaJ65T6EruyzmoQqI2BVDo= +sigs.k8s.io/randfill v0.0.0-20250304075658-069ef1bbf016/go.mod h1:XeLlZ/jmk4i1HRopwe7/aU3H5n1zNUcX6TM94b3QxOY= +sigs.k8s.io/randfill v1.0.0 h1:JfjMILfT8A6RbawdsK2JXGBR5AQVfd+9TbzrlneTyrU= +sigs.k8s.io/randfill v1.0.0/go.mod h1:XeLlZ/jmk4i1HRopwe7/aU3H5n1zNUcX6TM94b3QxOY= +sigs.k8s.io/structured-merge-diff/v4 v4.0.2/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= +sigs.k8s.io/structured-merge-diff/v4 v4.2.1/go.mod h1:j/nl6xW8vLS49O8YvXW1ocPhZawJtm+Yrr7PPRQ0Vg4= +sigs.k8s.io/structured-merge-diff/v4 v4.6.0 h1:IUA9nvMmnKWcj5jl84xn+T5MnlZKThmUW1TdblaLVAc= +sigs.k8s.io/structured-merge-diff/v4 v4.6.0/go.mod h1:dDy58f92j70zLsuZVuUX5Wp9vtxXpaZnkPGWeqDfCps= +sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= +sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= +sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= +sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= diff --git a/api/client/examples/resourceclaim/main.go b/api/client/examples/resourceclaim/main.go new file mode 100644 index 0000000000..aa27b73f46 --- /dev/null +++ b/api/client/examples/resourceclaim/main.go @@ -0,0 +1,211 @@ +/* +Copyright 2025 Flant JSC + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package main + +import ( + "context" + "fmt" + "os" + "os/signal" + "syscall" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/deckhouse/virtualization/api/client/kubeclient" + subv1alpha2 "github.com/deckhouse/virtualization/api/subresources/v1alpha2" + + "github.com/spf13/cobra" + "github.com/spf13/pflag" +) + +func main() { + ctx, _ := signal.NotifyContext(context.Background(), syscall.SIGTERM, os.Interrupt) + if err := NewResourceClaimCommand().ExecuteContext(ctx); err != nil { + _, _ = fmt.Fprintln(os.Stderr, err) + os.Exit(1) + } +} + +func NewResourceClaimCommand() *cobra.Command { + cmd := cobra.Command{ + Use: "resourceclaim (VirtualMachine)", + Short: "add/remove resource claim to/from a VirtualMachine.", + SilenceErrors: true, + SilenceUsage: true, + } + + cmd.AddCommand( + NewAddResourceClaimCommand(), + NewRemoveResourceClaimCommand(), + ) + + return &cmd +} + +func NewAddResourceClaimCommand() *cobra.Command { + opts := &addResourceClaimOptions{} + + cmd := cobra.Command{ + Use: "add (VirtualMachine)", + Short: "add resource claim to a VirtualMachine.", + Args: cobra.ExactArgs(1), + SilenceErrors: true, + SilenceUsage: true, + RunE: opts.Run, + } + + opts.AddFlags(cmd.Flags()) + + return &cmd +} + +type addResourceClaimOptions struct { + Namespace string + HotplugName string + RequestName string + ResourceClaimTemplateName string + DryRun bool +} + +func (o *addResourceClaimOptions) AddFlags(fs *pflag.FlagSet) { + fs.StringVarP(&o.Namespace, "namespace", "n", "", "namespace of virtual machine") + fs.StringVar(&o.HotplugName, "hotplug-name", "", "name of the hotplug device") + fs.StringVarP(&o.RequestName, "request-name", "r", "", "name of the resource claim request") + fs.StringVarP(&o.ResourceClaimTemplateName, "resource-claim-template-name", "t", "", "name of the resource claim template") + fs.BoolVarP(&o.DryRun, "dry-run", "d", false, "dry run") +} + +func (o *addResourceClaimOptions) Validate() error { + if o.HotplugName == "" { + return fmt.Errorf("hotplug-name is required") + } + if o.RequestName == "" { + return fmt.Errorf("request-name is required") + } + if o.ResourceClaimTemplateName == "" { + return fmt.Errorf("resource-claim-template-name is required") + } + return nil +} + +func (o *addResourceClaimOptions) Run(cmd *cobra.Command, args []string) error { + err := o.Validate() + if err != nil { + return err + } + + client, namespace, err := getClientAndNamespace(o.Namespace) + if err != nil { + return err + } + + name := args[0] + options := subv1alpha2.VirtualMachineAddResourceClaim{ + Name: o.HotplugName, + ResourceClaimTemplateName: o.ResourceClaimTemplateName, + RequestName: o.RequestName, + DryRun: dryRun(o.DryRun), + } + + cmd.Println("Options:", options) + + return client.VirtualMachines(namespace).AddResourceClaim(cmd.Context(), name, options) +} + +func NewRemoveResourceClaimCommand() *cobra.Command { + opts := removeResourceClaimOptions{} + + cmd := cobra.Command{ + Use: "remove (VirtualMachine)", + Short: "remove resource claim from a VirtualMachine.", + Args: cobra.ExactArgs(1), + SilenceErrors: true, + SilenceUsage: true, + RunE: opts.Run, + } + + opts.AddFlags(&cmd) + + return &cmd +} + +type removeResourceClaimOptions struct { + Namespace string + HotplugName string + DryRun bool +} + +func (o *removeResourceClaimOptions) AddFlags(cmd *cobra.Command) { + fs := cmd.Flags() + fs.StringVarP(&o.Namespace, "namespace", "n", "", "namespace of virtual machine") + fs.StringVar(&o.HotplugName, "hotplug-name", "", "name of the hotplug device") + fs.BoolVarP(&o.DryRun, "dry-run", "d", false, "dry run") +} + +func (o *removeResourceClaimOptions) Validate() error { + if o.HotplugName == "" { + return fmt.Errorf("hotplug-name is required") + } + return nil +} + +func (o *removeResourceClaimOptions) Run(cmd *cobra.Command, args []string) error { + err := o.Validate() + if err != nil { + return err + } + + client, namespace, err := getClientAndNamespace(o.Namespace) + if err != nil { + return err + } + + name := args[0] + options := subv1alpha2.VirtualMachineRemoveResourceClaim{ + Name: o.HotplugName, + DryRun: dryRun(o.DryRun), + } + + return client.VirtualMachines(namespace).RemoveResourceClaim(cmd.Context(), name, options) +} + +func getClientAndNamespace(defaultNamespace string) (kubeclient.Client, string, error) { + namespace := defaultNamespace + clientConfig := kubeclient.DefaultClientConfig(&pflag.FlagSet{}) + + if namespace == "" { + ns, _, err := clientConfig.Namespace() + if err != nil { + return nil, "", err + } + namespace = ns + } + + client, err := kubeclient.GetClientFromClientConfig(clientConfig) + if err != nil { + return nil, "", err + } + + return client, namespace, nil +} + +func dryRun(should bool) []string { + if should { + return []string{metav1.DryRunAll} + } + return nil +} diff --git a/api/client/generated/clientset/versioned/typed/core/v1alpha2/fake/fake_virtualmachine_expansion.go b/api/client/generated/clientset/versioned/typed/core/v1alpha2/fake/fake_virtualmachine_expansion.go index 470f7bf441..4f97c4978f 100644 --- a/api/client/generated/clientset/versioned/typed/core/v1alpha2/fake/fake_virtualmachine_expansion.go +++ b/api/client/generated/clientset/versioned/typed/core/v1alpha2/fake/fake_virtualmachine_expansion.go @@ -54,3 +54,11 @@ func (c *fakeVirtualMachines) RemoveVolume(ctx context.Context, name string, opt func (c *fakeVirtualMachines) CancelEvacuation(ctx context.Context, name string, dryRun []string) error { return nil } + +func (c *fakeVirtualMachines) AddResourceClaim(ctx context.Context, name string, opts v1alpha2.VirtualMachineAddResourceClaim) error { + return nil +} + +func (c *fakeVirtualMachines) RemoveResourceClaim(ctx context.Context, name string, opts v1alpha2.VirtualMachineRemoveResourceClaim) error { + return nil +} diff --git a/api/client/generated/clientset/versioned/typed/core/v1alpha2/virtualmachine_expansion.go b/api/client/generated/clientset/versioned/typed/core/v1alpha2/virtualmachine_expansion.go index 3fcd693016..c0bd144954 100644 --- a/api/client/generated/clientset/versioned/typed/core/v1alpha2/virtualmachine_expansion.go +++ b/api/client/generated/clientset/versioned/typed/core/v1alpha2/virtualmachine_expansion.go @@ -35,6 +35,8 @@ type VirtualMachineExpansion interface { AddVolume(ctx context.Context, name string, opts v1alpha2.VirtualMachineAddVolume) error RemoveVolume(ctx context.Context, name string, opts v1alpha2.VirtualMachineRemoveVolume) error CancelEvacuation(ctx context.Context, name string, dryRun []string) error + AddResourceClaim(ctx context.Context, name string, opts v1alpha2.VirtualMachineAddResourceClaim) error + RemoveResourceClaim(ctx context.Context, name string, opts v1alpha2.VirtualMachineRemoveResourceClaim) error } type SerialConsoleOptions struct { @@ -81,3 +83,11 @@ func (c *virtualMachines) RemoveVolume(ctx context.Context, name string, opts v1 func (c *virtualMachines) CancelEvacuation(ctx context.Context, name string, dryRun []string) error { return fmt.Errorf("not implemented") } + +func (c *virtualMachines) AddResourceClaim(ctx context.Context, name string, opts v1alpha2.VirtualMachineAddResourceClaim) error { + return fmt.Errorf("not implemented") +} + +func (c *virtualMachines) RemoveResourceClaim(ctx context.Context, name string, opts v1alpha2.VirtualMachineRemoveResourceClaim) error { + return fmt.Errorf("not implemented") +} diff --git a/api/client/kubeclient/vm.go b/api/client/kubeclient/vm.go index 2eb665ab57..b19399e2f4 100644 --- a/api/client/kubeclient/vm.go +++ b/api/client/kubeclient/vm.go @@ -165,3 +165,30 @@ func (v vm) CancelEvacuation(ctx context.Context, name string, dryRun []string) } return c.Do(ctx).Error() } + +func (v vm) AddResourceClaim(ctx context.Context, name string, opts subv1alpha2.VirtualMachineAddResourceClaim) error { + path := fmt.Sprintf(subresourceURLTpl, v.namespace, v.resource, name, "addresourceclaim") + c := v.restClient. + Put(). + AbsPath(path). + Param("name", opts.Name). + Param("resourceClaimTemplateName", opts.ResourceClaimTemplateName). + Param("requestName", opts.RequestName) + + for _, value := range opts.DryRun { + c.Param("dryRun", value) + } + return c.Do(ctx).Error() +} + +func (v vm) RemoveResourceClaim(ctx context.Context, name string, opts subv1alpha2.VirtualMachineRemoveResourceClaim) error { + path := fmt.Sprintf(subresourceURLTpl, v.namespace, v.resource, name, "removeresourceclaim") + c := v.restClient. + Put(). + AbsPath(path). + Param("name", opts.Name) + for _, value := range opts.DryRun { + c.Param("dryRun", value) + } + return c.Do(ctx).Error() +} diff --git a/api/subresources/register.go b/api/subresources/register.go index 9ee6a8786f..872ad19a8f 100644 --- a/api/subresources/register.go +++ b/api/subresources/register.go @@ -57,6 +57,8 @@ func addKnownTypes(scheme *runtime.Scheme) error { &VirtualMachineFreeze{}, &VirtualMachineUnfreeze{}, &VirtualMachineCancelEvacuation{}, + &VirtualMachineAddResourceClaim{}, + &VirtualMachineRemoveResourceClaim{}, ) return nil } diff --git a/api/subresources/types.go b/api/subresources/types.go index 5120aa5eb9..90ce98abaf 100644 --- a/api/subresources/types.go +++ b/api/subresources/types.go @@ -88,3 +88,24 @@ type VirtualMachineCancelEvacuation struct { DryRun []string } + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +type VirtualMachineAddResourceClaim struct { + metav1.TypeMeta + + Name string + ResourceClaimTemplateName string + RequestName string + + DryRun []string +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +type VirtualMachineRemoveResourceClaim struct { + metav1.TypeMeta + + Name string + DryRun []string +} diff --git a/api/subresources/v1alpha2/register.go b/api/subresources/v1alpha2/register.go index 944a906c66..d978d3f4f3 100644 --- a/api/subresources/v1alpha2/register.go +++ b/api/subresources/v1alpha2/register.go @@ -59,6 +59,8 @@ func addKnownTypes(scheme *runtime.Scheme) error { &VirtualMachineFreeze{}, &VirtualMachineUnfreeze{}, &VirtualMachineCancelEvacuation{}, + &VirtualMachineAddResourceClaim{}, + &VirtualMachineRemoveResourceClaim{}, ) return nil } diff --git a/api/subresources/v1alpha2/types.go b/api/subresources/v1alpha2/types.go index ddbbb77f8a..2bfcbcedbc 100644 --- a/api/subresources/v1alpha2/types.go +++ b/api/subresources/v1alpha2/types.go @@ -90,7 +90,30 @@ type VirtualMachineUnfreeze struct { // +k8s:conversion-gen:explicit-from=net/url.Values type VirtualMachineCancelEvacuation struct { + metav1.TypeMeta `json:",inline"` + + DryRun []string `json:"dryRun,omitempty"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:conversion-gen:explicit-from=net/url.Values + +type VirtualMachineAddResourceClaim struct { + metav1.TypeMeta `json:",inline"` + + Name string `json:"name"` + ResourceClaimTemplateName string `json:"resourceClaimTemplateName"` + RequestName string `json:"requestName"` + + DryRun []string `json:"dryRun,omitempty"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:conversion-gen:explicit-from=net/url.Values + +type VirtualMachineRemoveResourceClaim struct { metav1.TypeMeta + Name string `json:"name"` DryRun []string `json:"dryRun,omitempty"` } diff --git a/api/subresources/v1alpha2/zz_generated.conversion.go b/api/subresources/v1alpha2/zz_generated.conversion.go index d0572c32b0..7955b3f836 100644 --- a/api/subresources/v1alpha2/zz_generated.conversion.go +++ b/api/subresources/v1alpha2/zz_generated.conversion.go @@ -48,6 +48,16 @@ func RegisterConversions(s *runtime.Scheme) error { }); err != nil { return err } + if err := s.AddGeneratedConversionFunc((*VirtualMachineAddResourceClaim)(nil), (*subresources.VirtualMachineAddResourceClaim)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_VirtualMachineAddResourceClaim_To_subresources_VirtualMachineAddResourceClaim(a.(*VirtualMachineAddResourceClaim), b.(*subresources.VirtualMachineAddResourceClaim), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*subresources.VirtualMachineAddResourceClaim)(nil), (*VirtualMachineAddResourceClaim)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_subresources_VirtualMachineAddResourceClaim_To_v1alpha2_VirtualMachineAddResourceClaim(a.(*subresources.VirtualMachineAddResourceClaim), b.(*VirtualMachineAddResourceClaim), scope) + }); err != nil { + return err + } if err := s.AddGeneratedConversionFunc((*VirtualMachineAddVolume)(nil), (*subresources.VirtualMachineAddVolume)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1alpha2_VirtualMachineAddVolume_To_subresources_VirtualMachineAddVolume(a.(*VirtualMachineAddVolume), b.(*subresources.VirtualMachineAddVolume), scope) }); err != nil { @@ -98,6 +108,16 @@ func RegisterConversions(s *runtime.Scheme) error { }); err != nil { return err } + if err := s.AddGeneratedConversionFunc((*VirtualMachineRemoveResourceClaim)(nil), (*subresources.VirtualMachineRemoveResourceClaim)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_VirtualMachineRemoveResourceClaim_To_subresources_VirtualMachineRemoveResourceClaim(a.(*VirtualMachineRemoveResourceClaim), b.(*subresources.VirtualMachineRemoveResourceClaim), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*subresources.VirtualMachineRemoveResourceClaim)(nil), (*VirtualMachineRemoveResourceClaim)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_subresources_VirtualMachineRemoveResourceClaim_To_v1alpha2_VirtualMachineRemoveResourceClaim(a.(*subresources.VirtualMachineRemoveResourceClaim), b.(*VirtualMachineRemoveResourceClaim), scope) + }); err != nil { + return err + } if err := s.AddGeneratedConversionFunc((*VirtualMachineRemoveVolume)(nil), (*subresources.VirtualMachineRemoveVolume)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1alpha2_VirtualMachineRemoveVolume_To_subresources_VirtualMachineRemoveVolume(a.(*VirtualMachineRemoveVolume), b.(*subresources.VirtualMachineRemoveVolume), scope) }); err != nil { @@ -128,6 +148,11 @@ func RegisterConversions(s *runtime.Scheme) error { }); err != nil { return err } + if err := s.AddGeneratedConversionFunc((*url.Values)(nil), (*VirtualMachineAddResourceClaim)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_url_Values_To_v1alpha2_VirtualMachineAddResourceClaim(a.(*url.Values), b.(*VirtualMachineAddResourceClaim), scope) + }); err != nil { + return err + } if err := s.AddGeneratedConversionFunc((*url.Values)(nil), (*VirtualMachineAddVolume)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_url_Values_To_v1alpha2_VirtualMachineAddVolume(a.(*url.Values), b.(*VirtualMachineAddVolume), scope) }); err != nil { @@ -153,6 +178,11 @@ func RegisterConversions(s *runtime.Scheme) error { }); err != nil { return err } + if err := s.AddGeneratedConversionFunc((*url.Values)(nil), (*VirtualMachineRemoveResourceClaim)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_url_Values_To_v1alpha2_VirtualMachineRemoveResourceClaim(a.(*url.Values), b.(*VirtualMachineRemoveResourceClaim), scope) + }); err != nil { + return err + } if err := s.AddGeneratedConversionFunc((*url.Values)(nil), (*VirtualMachineRemoveVolume)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_url_Values_To_v1alpha2_VirtualMachineRemoveVolume(a.(*url.Values), b.(*VirtualMachineRemoveVolume), scope) }); err != nil { @@ -191,6 +221,69 @@ func Convert_subresources_VirtualMachine_To_v1alpha2_VirtualMachine(in *subresou return autoConvert_subresources_VirtualMachine_To_v1alpha2_VirtualMachine(in, out, s) } +func autoConvert_v1alpha2_VirtualMachineAddResourceClaim_To_subresources_VirtualMachineAddResourceClaim(in *VirtualMachineAddResourceClaim, out *subresources.VirtualMachineAddResourceClaim, s conversion.Scope) error { + out.Name = in.Name + out.ResourceClaimTemplateName = in.ResourceClaimTemplateName + out.RequestName = in.RequestName + out.DryRun = *(*[]string)(unsafe.Pointer(&in.DryRun)) + return nil +} + +// Convert_v1alpha2_VirtualMachineAddResourceClaim_To_subresources_VirtualMachineAddResourceClaim is an autogenerated conversion function. +func Convert_v1alpha2_VirtualMachineAddResourceClaim_To_subresources_VirtualMachineAddResourceClaim(in *VirtualMachineAddResourceClaim, out *subresources.VirtualMachineAddResourceClaim, s conversion.Scope) error { + return autoConvert_v1alpha2_VirtualMachineAddResourceClaim_To_subresources_VirtualMachineAddResourceClaim(in, out, s) +} + +func autoConvert_subresources_VirtualMachineAddResourceClaim_To_v1alpha2_VirtualMachineAddResourceClaim(in *subresources.VirtualMachineAddResourceClaim, out *VirtualMachineAddResourceClaim, s conversion.Scope) error { + out.Name = in.Name + out.ResourceClaimTemplateName = in.ResourceClaimTemplateName + out.RequestName = in.RequestName + out.DryRun = *(*[]string)(unsafe.Pointer(&in.DryRun)) + return nil +} + +// Convert_subresources_VirtualMachineAddResourceClaim_To_v1alpha2_VirtualMachineAddResourceClaim is an autogenerated conversion function. +func Convert_subresources_VirtualMachineAddResourceClaim_To_v1alpha2_VirtualMachineAddResourceClaim(in *subresources.VirtualMachineAddResourceClaim, out *VirtualMachineAddResourceClaim, s conversion.Scope) error { + return autoConvert_subresources_VirtualMachineAddResourceClaim_To_v1alpha2_VirtualMachineAddResourceClaim(in, out, s) +} + +func autoConvert_url_Values_To_v1alpha2_VirtualMachineAddResourceClaim(in *url.Values, out *VirtualMachineAddResourceClaim, s conversion.Scope) error { + // WARNING: Field TypeMeta does not have json tag, skipping. + + if values, ok := map[string][]string(*in)["name"]; ok && len(values) > 0 { + if err := runtime.Convert_Slice_string_To_string(&values, &out.Name, s); err != nil { + return err + } + } else { + out.Name = "" + } + if values, ok := map[string][]string(*in)["resourceClaimTemplateName"]; ok && len(values) > 0 { + if err := runtime.Convert_Slice_string_To_string(&values, &out.ResourceClaimTemplateName, s); err != nil { + return err + } + } else { + out.ResourceClaimTemplateName = "" + } + if values, ok := map[string][]string(*in)["requestName"]; ok && len(values) > 0 { + if err := runtime.Convert_Slice_string_To_string(&values, &out.RequestName, s); err != nil { + return err + } + } else { + out.RequestName = "" + } + if values, ok := map[string][]string(*in)["dryRun"]; ok && len(values) > 0 { + out.DryRun = *(*[]string)(unsafe.Pointer(&values)) + } else { + out.DryRun = nil + } + return nil +} + +// Convert_url_Values_To_v1alpha2_VirtualMachineAddResourceClaim is an autogenerated conversion function. +func Convert_url_Values_To_v1alpha2_VirtualMachineAddResourceClaim(in *url.Values, out *VirtualMachineAddResourceClaim, s conversion.Scope) error { + return autoConvert_url_Values_To_v1alpha2_VirtualMachineAddResourceClaim(in, out, s) +} + func autoConvert_v1alpha2_VirtualMachineAddVolume_To_subresources_VirtualMachineAddVolume(in *VirtualMachineAddVolume, out *subresources.VirtualMachineAddVolume, s conversion.Scope) error { out.Name = in.Name out.VolumeKind = in.VolumeKind @@ -422,6 +515,51 @@ func Convert_url_Values_To_v1alpha2_VirtualMachinePortForward(in *url.Values, ou return autoConvert_url_Values_To_v1alpha2_VirtualMachinePortForward(in, out, s) } +func autoConvert_v1alpha2_VirtualMachineRemoveResourceClaim_To_subresources_VirtualMachineRemoveResourceClaim(in *VirtualMachineRemoveResourceClaim, out *subresources.VirtualMachineRemoveResourceClaim, s conversion.Scope) error { + out.Name = in.Name + out.DryRun = *(*[]string)(unsafe.Pointer(&in.DryRun)) + return nil +} + +// Convert_v1alpha2_VirtualMachineRemoveResourceClaim_To_subresources_VirtualMachineRemoveResourceClaim is an autogenerated conversion function. +func Convert_v1alpha2_VirtualMachineRemoveResourceClaim_To_subresources_VirtualMachineRemoveResourceClaim(in *VirtualMachineRemoveResourceClaim, out *subresources.VirtualMachineRemoveResourceClaim, s conversion.Scope) error { + return autoConvert_v1alpha2_VirtualMachineRemoveResourceClaim_To_subresources_VirtualMachineRemoveResourceClaim(in, out, s) +} + +func autoConvert_subresources_VirtualMachineRemoveResourceClaim_To_v1alpha2_VirtualMachineRemoveResourceClaim(in *subresources.VirtualMachineRemoveResourceClaim, out *VirtualMachineRemoveResourceClaim, s conversion.Scope) error { + out.Name = in.Name + out.DryRun = *(*[]string)(unsafe.Pointer(&in.DryRun)) + return nil +} + +// Convert_subresources_VirtualMachineRemoveResourceClaim_To_v1alpha2_VirtualMachineRemoveResourceClaim is an autogenerated conversion function. +func Convert_subresources_VirtualMachineRemoveResourceClaim_To_v1alpha2_VirtualMachineRemoveResourceClaim(in *subresources.VirtualMachineRemoveResourceClaim, out *VirtualMachineRemoveResourceClaim, s conversion.Scope) error { + return autoConvert_subresources_VirtualMachineRemoveResourceClaim_To_v1alpha2_VirtualMachineRemoveResourceClaim(in, out, s) +} + +func autoConvert_url_Values_To_v1alpha2_VirtualMachineRemoveResourceClaim(in *url.Values, out *VirtualMachineRemoveResourceClaim, s conversion.Scope) error { + // WARNING: Field TypeMeta does not have json tag, skipping. + + if values, ok := map[string][]string(*in)["name"]; ok && len(values) > 0 { + if err := runtime.Convert_Slice_string_To_string(&values, &out.Name, s); err != nil { + return err + } + } else { + out.Name = "" + } + if values, ok := map[string][]string(*in)["dryRun"]; ok && len(values) > 0 { + out.DryRun = *(*[]string)(unsafe.Pointer(&values)) + } else { + out.DryRun = nil + } + return nil +} + +// Convert_url_Values_To_v1alpha2_VirtualMachineRemoveResourceClaim is an autogenerated conversion function. +func Convert_url_Values_To_v1alpha2_VirtualMachineRemoveResourceClaim(in *url.Values, out *VirtualMachineRemoveResourceClaim, s conversion.Scope) error { + return autoConvert_url_Values_To_v1alpha2_VirtualMachineRemoveResourceClaim(in, out, s) +} + func autoConvert_v1alpha2_VirtualMachineRemoveVolume_To_subresources_VirtualMachineRemoveVolume(in *VirtualMachineRemoveVolume, out *subresources.VirtualMachineRemoveVolume, s conversion.Scope) error { out.Name = in.Name return nil diff --git a/api/subresources/v1alpha2/zz_generated.deepcopy.go b/api/subresources/v1alpha2/zz_generated.deepcopy.go index 65bcb843ec..6554e97509 100644 --- a/api/subresources/v1alpha2/zz_generated.deepcopy.go +++ b/api/subresources/v1alpha2/zz_generated.deepcopy.go @@ -52,6 +52,36 @@ func (in *VirtualMachine) DeepCopyObject() runtime.Object { return nil } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualMachineAddResourceClaim) DeepCopyInto(out *VirtualMachineAddResourceClaim) { + *out = *in + out.TypeMeta = in.TypeMeta + if in.DryRun != nil { + in, out := &in.DryRun, &out.DryRun + *out = make([]string, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineAddResourceClaim. +func (in *VirtualMachineAddResourceClaim) DeepCopy() *VirtualMachineAddResourceClaim { + if in == nil { + return nil + } + out := new(VirtualMachineAddResourceClaim) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *VirtualMachineAddResourceClaim) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *VirtualMachineAddVolume) DeepCopyInto(out *VirtualMachineAddVolume) { *out = *in @@ -187,6 +217,36 @@ func (in *VirtualMachinePortForward) DeepCopyObject() runtime.Object { return nil } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualMachineRemoveResourceClaim) DeepCopyInto(out *VirtualMachineRemoveResourceClaim) { + *out = *in + out.TypeMeta = in.TypeMeta + if in.DryRun != nil { + in, out := &in.DryRun, &out.DryRun + *out = make([]string, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineRemoveResourceClaim. +func (in *VirtualMachineRemoveResourceClaim) DeepCopy() *VirtualMachineRemoveResourceClaim { + if in == nil { + return nil + } + out := new(VirtualMachineRemoveResourceClaim) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *VirtualMachineRemoveResourceClaim) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *VirtualMachineRemoveVolume) DeepCopyInto(out *VirtualMachineRemoveVolume) { *out = *in diff --git a/api/subresources/zz_generated.deepcopy.go b/api/subresources/zz_generated.deepcopy.go index c09a9c8b33..8268bde57f 100644 --- a/api/subresources/zz_generated.deepcopy.go +++ b/api/subresources/zz_generated.deepcopy.go @@ -52,6 +52,36 @@ func (in *VirtualMachine) DeepCopyObject() runtime.Object { return nil } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualMachineAddResourceClaim) DeepCopyInto(out *VirtualMachineAddResourceClaim) { + *out = *in + out.TypeMeta = in.TypeMeta + if in.DryRun != nil { + in, out := &in.DryRun, &out.DryRun + *out = make([]string, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineAddResourceClaim. +func (in *VirtualMachineAddResourceClaim) DeepCopy() *VirtualMachineAddResourceClaim { + if in == nil { + return nil + } + out := new(VirtualMachineAddResourceClaim) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *VirtualMachineAddResourceClaim) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *VirtualMachineAddVolume) DeepCopyInto(out *VirtualMachineAddVolume) { *out = *in @@ -187,6 +217,36 @@ func (in *VirtualMachinePortForward) DeepCopyObject() runtime.Object { return nil } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualMachineRemoveResourceClaim) DeepCopyInto(out *VirtualMachineRemoveResourceClaim) { + *out = *in + out.TypeMeta = in.TypeMeta + if in.DryRun != nil { + in, out := &in.DryRun, &out.DryRun + *out = make([]string, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineRemoveResourceClaim. +func (in *VirtualMachineRemoveResourceClaim) DeepCopy() *VirtualMachineRemoveResourceClaim { + if in == nil { + return nil + } + out := new(VirtualMachineRemoveResourceClaim) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *VirtualMachineRemoveResourceClaim) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *VirtualMachineRemoveVolume) DeepCopyInto(out *VirtualMachineRemoveVolume) { *out = *in diff --git a/build/components/versions.yml b/build/components/versions.yml index 431fd33e11..0c2137e2bd 100644 --- a/build/components/versions.yml +++ b/build/components/versions.yml @@ -3,7 +3,7 @@ firmware: libvirt: v10.9.0 edk2: stable202411 core: - 3p-kubevirt: feat/add-dra-usb-support # v1.6.2-v12n.newversionXII + 3p-kubevirt: feat/add-dra-hotplug-support # v1.6.2-v12n.newversionXII 3p-containerized-data-importer: v1.60.3-v12n.12 distribution: 2.8.3 package: diff --git a/crds/embedded/virtualmachineinstances.yaml b/crds/embedded/virtualmachineinstances.yaml index c4be115def..1d3afc34bc 100644 --- a/crds/embedded/virtualmachineinstances.yaml +++ b/crds/embedded/virtualmachineinstances.yaml @@ -2787,6 +2787,8 @@ spec: It adds a name to it that uniquely identifies the ResourceClaim inside the Pod. Containers that need access to the ResourceClaim reference it with this name. properties: + hotpluggable: + type: boolean name: description: |- Name uniquely identifies this resource claim inside the pod. @@ -3631,7 +3633,6 @@ spec: description: PCIAddress is the PCIe bus address of the allocated device type: string - type: object type: object name: description: Name is the name of actual device on the @@ -3642,6 +3643,17 @@ spec: claims object used to provision this resource type: string type: object + hotplug: + properties: + attachPodName: + description: AttachPodName is the name of the pod used to + attach the device to the node. + type: string + attachPodUID: + description: AttachPodUID is the UID of the pod used to attach + the device to the node. + type: string + type: object name: description: Name of the device as specified in spec.domain.devices.gpus.name or spec.domain.devices.hostDevices.name @@ -3700,6 +3712,17 @@ spec: claims object used to provision this resource type: string type: object + hotplug: + properties: + attachPodName: + description: AttachPodName is the name of the pod used to + attach the device to the node. + type: string + attachPodUID: + description: AttachPodUID is the UID of the pod used to attach + the device to the node. + type: string + type: object name: description: Name of the device as specified in spec.domain.devices.gpus.name or spec.domain.devices.hostDevices.name @@ -7241,6 +7264,8 @@ spec: It adds a name to it that uniquely identifies the ResourceClaim inside the Pod. Containers that need access to the ResourceClaim reference it with this name. properties: + hotpluggable: + type: boolean name: description: |- Name uniquely identifies this resource claim inside the pod. diff --git a/crds/embedded/virtualmachines.yaml b/crds/embedded/virtualmachines.yaml index 245f2f6ce0..277dfd0329 100644 --- a/crds/embedded/virtualmachines.yaml +++ b/crds/embedded/virtualmachines.yaml @@ -3579,6 +3579,8 @@ spec: It adds a name to it that uniquely identifies the ResourceClaim inside the Pod. Containers that need access to the ResourceClaim reference it with this name. properties: + hotpluggable: + type: boolean name: description: |- Name uniquely identifies this resource claim inside the pod. @@ -4799,6 +4801,130 @@ spec: type: object type: array x-kubernetes-list-type: atomic + resourceClaimRequests: + description: |- + ResourceClaimRequests indicates a list of resource claims add or remove from the VMI template and + hotplug on an active running VMI. + items: + properties: + addResourceClaimOptions: + description: |- + AddResourceClaimOptions when set indicates a resource claim should be added. + The details within this field specify how to add the resource claim + properties: + dryRun: + description: |- + When present, indicates that modifications should not be + persisted. An invalid or unrecognized dryRun directive will + result in an error response and no further processing of the + request. Valid values are: + - All: all dry run stages will be processed + items: + type: string + type: array + x-kubernetes-list-type: atomic + hostDevice: + description: HostDevice represents the host device that will be + plugged into the running VMI + properties: + claimName: + description: |- + ClaimName needs to be provided from the list vmi.spec.resourceClaims[].name where this + device is allocated + type: string + deviceName: + description: DeviceName is the name of the device provisioned + by device-plugins + type: string + name: + type: string + requestName: + description: |- + RequestName needs to be provided from resourceClaim.spec.devices.requests[].name where this + device is requested + type: string + tag: + description: If specified, the virtual network interface address + and its tag will be provided to the guest via config drive + type: string + required: + - name + type: object + name: + description: |- + Name represents the name that will be used to map the + device to the corresponding resource claim. This overrides any name + that is set in the Device struct itself. + type: string + resourceClaim: + description: ResourceClaim represents the resource claim to map + to the host device + properties: + hotpluggable: + type: boolean + name: + description: |- + Name uniquely identifies this resource claim inside the pod. + This must be a DNS_LABEL. + type: string + resourceClaimName: + description: |- + ResourceClaimName is the name of a ResourceClaim object in the same + namespace as this pod. + + Exactly one of ResourceClaimName and ResourceClaimTemplateName must + be set. + type: string + resourceClaimTemplateName: + description: |- + ResourceClaimTemplateName is the name of a ResourceClaimTemplate + object in the same namespace as this pod. + + The template will be used to create a new ResourceClaim, which will + be bound to this pod. When this pod is deleted, the ResourceClaim + will also be deleted. The pod name and resource name, along with a + generated component, will be used to form a unique name for the + ResourceClaim, which will be recorded in pod.status.resourceClaimStatuses. + + This field is immutable and no changes will be made to the + corresponding ResourceClaim by the control plane after creating the + ResourceClaim. + + Exactly one of ResourceClaimName and ResourceClaimTemplateName must + be set. + type: string + required: + - name + type: object + required: + - hostDevice + - name + - resourceClaim + type: object + removeResourceClaimOptions: + description: |- + RemoveResourceClaimOptions when set indicates a resource claim should be removed. + The details within this field specify how to remove the resource claim + properties: + dryRun: + description: |- + When present, indicates that modifications should not be + persisted. An invalid or unrecognized dryRun directive will + result in an error response and no further processing of the + request. Valid values are: + - All: all dry run stages will be processed + items: + type: string + type: array + x-kubernetes-list-type: atomic + name: + type: string + required: + - name + type: object + type: object + type: array + x-kubernetes-list-type: atomic volumeSnapshotStatuses: description: |- VolumeSnapshotStatuses indicates a list of statuses whether snapshotting is @@ -8486,6 +8612,8 @@ spec: It adds a name to it that uniquely identifies the ResourceClaim inside the Pod. Containers that need access to the ResourceClaim reference it with this name. properties: + hotpluggable: + type: boolean name: description: |- Name uniquely identifies this resource claim inside the pod. diff --git a/images/hooks/go.mod b/images/hooks/go.mod index 3aa044a027..36fc27b808 100644 --- a/images/hooks/go.mod +++ b/images/hooks/go.mod @@ -136,3 +136,6 @@ replace ( golang.org/x/net => golang.org/x/net v0.40.0 // CVE-2025-22870, CVE-2025-22872 golang.org/x/oauth2 => golang.org/x/oauth2 v0.27.0 // CVE-2025-22868 ) + +// Kubevirt API replaces +replace kubevirt.io/api => github.com/deckhouse/3p-kubevirt/staging/src/kubevirt.io/api v1.6.2-add-dra-hotplug-support diff --git a/images/hooks/go.sum b/images/hooks/go.sum index 663744542f..47d27ab036 100644 --- a/images/hooks/go.sum +++ b/images/hooks/go.sum @@ -38,6 +38,8 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/deckhouse/3p-kubevirt/staging/src/kubevirt.io/api v1.6.2-add-dra-hotplug-support h1:Pq9YFlcqwbd7D/6kbRwIAIRbjNv6e92+VPS0ttOCUv0= +github.com/deckhouse/3p-kubevirt/staging/src/kubevirt.io/api v1.6.2-add-dra-hotplug-support/go.mod h1:p66fEy/g79x7VpgUwrkUgOoG2lYs5LQq37WM6JXMwj4= github.com/deckhouse/deckhouse/pkg/log v0.0.0-20250424095005-9ab587d01d7a h1:c4CKIIsfpCn9wzMziOPfrqptAuHLCtTPM/heobSxPfk= github.com/deckhouse/deckhouse/pkg/log v0.0.0-20250424095005-9ab587d01d7a/go.mod h1:pbAxTSDcPmwyl3wwKDcEB3qdxHnRxqTV+J0K+sha8bw= github.com/deckhouse/module-sdk v0.3.3 h1:wyrLZekD2qLCRXUQtbs7mSVRXmSDIQCfS5Uk1zk3eZg= @@ -623,8 +625,6 @@ k8s.io/utils v0.0.0-20240711033017-18e509b52bc8/go.mod h1:OLgZIPagt7ERELqWJFomSt k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= k8s.io/utils v0.0.0-20250604170112-4c0f3b243397 h1:hwvWFiBzdWw1FhfY1FooPn3kzWuJ8tmbZBHi4zVsl1Y= k8s.io/utils v0.0.0-20250604170112-4c0f3b243397/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= -kubevirt.io/api v1.6.2 h1:aoqZ4KsbOyDjLnuDw7H9wEgE/YTd/q5BBmYeQjJNizc= -kubevirt.io/api v1.6.2/go.mod h1:p66fEy/g79x7VpgUwrkUgOoG2lYs5LQq37WM6JXMwj4= kubevirt.io/containerized-data-importer-api v1.60.3 h1:kQEXi7scpzUa0RPf3/3MKk1Kmem0ZlqqiuK3kDF5L2I= kubevirt.io/containerized-data-importer-api v1.60.3/go.mod h1:8mwrkZIdy8j/LmCyKt2wFXbiMavLUIqDaegaIF67CZs= kubevirt.io/controller-lifecycle-operator-sdk/api v0.0.0-20220329064328-f3cc58c6ed90 h1:QMrd0nKP0BGbnxTqakhDZAUhGKxPiPiN5gSDqKUmGGc= diff --git a/images/virt-api/debug/dlv.Dockerfile b/images/virt-api/debug/dlv.Dockerfile index bca504a4d3..b3611ca9ea 100644 --- a/images/virt-api/debug/dlv.Dockerfile +++ b/images/virt-api/debug/dlv.Dockerfile @@ -1,10 +1,10 @@ -FROM golang:1.22.7 AS builder +FROM golang:1.23.0 AS builder RUN go install github.com/go-delve/delve/cmd/dlv@latest -ARG BRANCH="1.3.1-virtualization" -ENV VERSION="1.3.1" -ENV GOVERSION="1.22.7" +ARG BRANCH="1.6.2-virtualization" +ENV VERSION="1.6.2" +ENV GOVERSION="1.23.0" # Copy the git commits for rebuilding the image if the branch changes ADD "https://api.github.com/repos/deckhouse/3p-kubevirt/commits/$BRANCH" /.git-commit-hash.tmp @@ -14,7 +14,13 @@ WORKDIR /kubevirt RUN go mod edit -go=$GOVERSION && \ go mod download -RUN go mod vendor +RUN go work vendor + + +RUN for p in $(test -d patches && ls -1 patches/*.patch 2>/dev/null) ; do \ + echo -n "Apply ${p} ... " ; \ + git apply --ignore-space-change --ignore-whitespace ${p} && echo OK || (echo FAIL ; exit 1) ; \ + done ENV GO111MODULE=on ENV GOOS=linux diff --git a/images/virt-artifact/werf.inc.yaml b/images/virt-artifact/werf.inc.yaml index 3a6060a535..20f3ecaff6 100644 --- a/images/virt-artifact/werf.inc.yaml +++ b/images/virt-artifact/werf.inc.yaml @@ -9,7 +9,7 @@ image: {{ .ModuleNamePrefix }}{{ .ImageName }}-src-artifact final: false fromImage: builder/src -fromCacheVersion: "0002" # TODO: remove this +fromCacheVersion: "hotplug-0016" # TODO: remove this secrets: - id: SOURCE_REPO value: {{ $.SOURCE_REPO }} diff --git a/images/virt-controller/debug/dlv.Dockerfile b/images/virt-controller/debug/dlv.Dockerfile index 8f513efc1e..28bd42309a 100644 --- a/images/virt-controller/debug/dlv.Dockerfile +++ b/images/virt-controller/debug/dlv.Dockerfile @@ -16,6 +16,11 @@ RUN go mod edit -go=$GOVERSION && \ RUN go work vendor +RUN for p in $(test -d patches && ls -1 patches/*.patch 2>/dev/null) ; do \ + echo -n "Apply ${p} ... " ; \ + git apply --ignore-space-change --ignore-whitespace ${p} && echo OK || (echo FAIL ; exit 1) ; \ + done + ENV GO111MODULE=on ENV GOOS=linux ENV CGO_ENABLED=0 diff --git a/images/virt-handler/debug/dlv.Dockerfile b/images/virt-handler/debug/dlv.Dockerfile index 204345fe7b..2450ffcd2e 100644 --- a/images/virt-handler/debug/dlv.Dockerfile +++ b/images/virt-handler/debug/dlv.Dockerfile @@ -34,6 +34,11 @@ RUN go mod edit -go=$GOVERSION && \ RUN go work vendor +RUN for p in $(test -d patches && ls -1 patches/*.patch 2>/dev/null) ; do \ + echo -n "Apply ${p} ... " ; \ + git apply --ignore-space-change --ignore-whitespace ${p} && echo OK || (echo FAIL ; exit 1) ; \ + done + ENV GO111MODULE=on ENV GOOS=linux ENV CGO_ENABLED=1 diff --git a/images/virt-launcher/mount-points.yaml b/images/virt-launcher/mount-points.yaml index 3d14d257ff..7436eab451 100644 --- a/images/virt-launcher/mount-points.yaml +++ b/images/virt-launcher/mount-points.yaml @@ -47,3 +47,4 @@ dirs: - /var/log/libvirt - /path # For hot-plugged disks, used in "hp Pods". - /init/usr/bin # For attaching images as "container disks". + - /dev/bus/usb # For hot-plugged USB devices, used in "hp Pods". diff --git a/images/virtualization-artifact/go.mod b/images/virtualization-artifact/go.mod index 83166e7cfb..a139ba6748 100644 --- a/images/virtualization-artifact/go.mod +++ b/images/virtualization-artifact/go.mod @@ -165,4 +165,4 @@ replace ( ) // Kubevirt API replaces -replace kubevirt.io/api => github.com/deckhouse/3p-kubevirt/staging/src/kubevirt.io/api v1.6.2-v12n.newversionXII +replace kubevirt.io/api => github.com/deckhouse/3p-kubevirt/staging/src/kubevirt.io/api v1.6.2-add-dra-hotplug-support diff --git a/images/virtualization-artifact/go.sum b/images/virtualization-artifact/go.sum index bb6480d5ac..24bd678d7a 100644 --- a/images/virtualization-artifact/go.sum +++ b/images/virtualization-artifact/go.sum @@ -45,8 +45,8 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/deckhouse/3p-kubevirt/staging/src/kubevirt.io/api v1.6.2-v12n.newversionXII h1:KFyiijDjbCFzUI8g6ROf1gz48xvGPzyg0Q5mOrRlUIc= -github.com/deckhouse/3p-kubevirt/staging/src/kubevirt.io/api v1.6.2-v12n.newversionXII/go.mod h1:p66fEy/g79x7VpgUwrkUgOoG2lYs5LQq37WM6JXMwj4= +github.com/deckhouse/3p-kubevirt/staging/src/kubevirt.io/api v1.6.2-add-dra-hotplug-support h1:Pq9YFlcqwbd7D/6kbRwIAIRbjNv6e92+VPS0ttOCUv0= +github.com/deckhouse/3p-kubevirt/staging/src/kubevirt.io/api v1.6.2-add-dra-hotplug-support/go.mod h1:p66fEy/g79x7VpgUwrkUgOoG2lYs5LQq37WM6JXMwj4= github.com/deckhouse/deckhouse/pkg/log v0.0.0-20250226105106-176cd3afcdd5 h1:PsN1E0oxC/+4zdA977txrqUCuObFL3HAuu5Xnud8m8c= github.com/deckhouse/deckhouse/pkg/log v0.0.0-20250226105106-176cd3afcdd5/go.mod h1:Mk5HRzkc5pIcDIZ2JJ6DPuuqnwhXVkb3you8M8Mg+4w= github.com/distribution/reference v0.5.0 h1:/FUIFXtfc/x2gpa5/VGfiGLuOIdYa1t65IKK2OFGvA0= diff --git a/images/virtualization-artifact/pkg/apiserver/api/generated/openapi/zz_generated.openapi.go b/images/virtualization-artifact/pkg/apiserver/api/generated/openapi/zz_generated.openapi.go index e21b8679f5..1e04becd19 100644 --- a/images/virtualization-artifact/pkg/apiserver/api/generated/openapi/zz_generated.openapi.go +++ b/images/virtualization-artifact/pkg/apiserver/api/generated/openapi/zz_generated.openapi.go @@ -29,78 +29,80 @@ import ( func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenAPIDefinition { return map[string]common.OpenAPIDefinition{ - "github.com/deckhouse/virtualization/api/core/v1alpha3.CPU": schema_virtualization_api_core_v1alpha3_CPU(ref), - "github.com/deckhouse/virtualization/api/core/v1alpha3.CpuDiscovery": schema_virtualization_api_core_v1alpha3_CpuDiscovery(ref), - "github.com/deckhouse/virtualization/api/core/v1alpha3.CpuFeatures": schema_virtualization_api_core_v1alpha3_CpuFeatures(ref), - "github.com/deckhouse/virtualization/api/core/v1alpha3.MemoryMinMax": schema_virtualization_api_core_v1alpha3_MemoryMinMax(ref), - "github.com/deckhouse/virtualization/api/core/v1alpha3.NodeSelector": schema_virtualization_api_core_v1alpha3_NodeSelector(ref), - "github.com/deckhouse/virtualization/api/core/v1alpha3.SizingPolicy": schema_virtualization_api_core_v1alpha3_SizingPolicy(ref), - "github.com/deckhouse/virtualization/api/core/v1alpha3.SizingPolicyCores": schema_virtualization_api_core_v1alpha3_SizingPolicyCores(ref), - "github.com/deckhouse/virtualization/api/core/v1alpha3.SizingPolicyMemory": schema_virtualization_api_core_v1alpha3_SizingPolicyMemory(ref), - "github.com/deckhouse/virtualization/api/core/v1alpha3.SizingPolicyMemoryPerCore": schema_virtualization_api_core_v1alpha3_SizingPolicyMemoryPerCore(ref), - "github.com/deckhouse/virtualization/api/core/v1alpha3.VirtualMachineClass": schema_virtualization_api_core_v1alpha3_VirtualMachineClass(ref), - "github.com/deckhouse/virtualization/api/core/v1alpha3.VirtualMachineClassList": schema_virtualization_api_core_v1alpha3_VirtualMachineClassList(ref), - "github.com/deckhouse/virtualization/api/core/v1alpha3.VirtualMachineClassSpec": schema_virtualization_api_core_v1alpha3_VirtualMachineClassSpec(ref), - "github.com/deckhouse/virtualization/api/core/v1alpha3.VirtualMachineClassStatus": schema_virtualization_api_core_v1alpha3_VirtualMachineClassStatus(ref), - "github.com/deckhouse/virtualization/api/subresources/v1alpha2.VirtualMachine": schema_virtualization_api_subresources_v1alpha2_VirtualMachine(ref), - "github.com/deckhouse/virtualization/api/subresources/v1alpha2.VirtualMachineAddVolume": schema_virtualization_api_subresources_v1alpha2_VirtualMachineAddVolume(ref), - "github.com/deckhouse/virtualization/api/subresources/v1alpha2.VirtualMachineCancelEvacuation": schema_virtualization_api_subresources_v1alpha2_VirtualMachineCancelEvacuation(ref), - "github.com/deckhouse/virtualization/api/subresources/v1alpha2.VirtualMachineConsole": schema_virtualization_api_subresources_v1alpha2_VirtualMachineConsole(ref), - "github.com/deckhouse/virtualization/api/subresources/v1alpha2.VirtualMachineFreeze": schema_virtualization_api_subresources_v1alpha2_VirtualMachineFreeze(ref), - "github.com/deckhouse/virtualization/api/subresources/v1alpha2.VirtualMachinePortForward": schema_virtualization_api_subresources_v1alpha2_VirtualMachinePortForward(ref), - "github.com/deckhouse/virtualization/api/subresources/v1alpha2.VirtualMachineRemoveVolume": schema_virtualization_api_subresources_v1alpha2_VirtualMachineRemoveVolume(ref), - "github.com/deckhouse/virtualization/api/subresources/v1alpha2.VirtualMachineUnfreeze": schema_virtualization_api_subresources_v1alpha2_VirtualMachineUnfreeze(ref), - "github.com/deckhouse/virtualization/api/subresources/v1alpha2.VirtualMachineVNC": schema_virtualization_api_subresources_v1alpha2_VirtualMachineVNC(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.APIGroup": schema_pkg_apis_meta_v1_APIGroup(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.APIGroupList": schema_pkg_apis_meta_v1_APIGroupList(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.APIResource": schema_pkg_apis_meta_v1_APIResource(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.APIResourceList": schema_pkg_apis_meta_v1_APIResourceList(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.APIVersions": schema_pkg_apis_meta_v1_APIVersions(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.ApplyOptions": schema_pkg_apis_meta_v1_ApplyOptions(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.Condition": schema_pkg_apis_meta_v1_Condition(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.CreateOptions": schema_pkg_apis_meta_v1_CreateOptions(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.DeleteOptions": schema_pkg_apis_meta_v1_DeleteOptions(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.Duration": schema_pkg_apis_meta_v1_Duration(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.FieldSelectorRequirement": schema_pkg_apis_meta_v1_FieldSelectorRequirement(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.FieldsV1": schema_pkg_apis_meta_v1_FieldsV1(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.GetOptions": schema_pkg_apis_meta_v1_GetOptions(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.GroupKind": schema_pkg_apis_meta_v1_GroupKind(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.GroupResource": schema_pkg_apis_meta_v1_GroupResource(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.GroupVersion": schema_pkg_apis_meta_v1_GroupVersion(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.GroupVersionForDiscovery": schema_pkg_apis_meta_v1_GroupVersionForDiscovery(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.GroupVersionKind": schema_pkg_apis_meta_v1_GroupVersionKind(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.GroupVersionResource": schema_pkg_apis_meta_v1_GroupVersionResource(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.InternalEvent": schema_pkg_apis_meta_v1_InternalEvent(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector": schema_pkg_apis_meta_v1_LabelSelector(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelectorRequirement": schema_pkg_apis_meta_v1_LabelSelectorRequirement(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.List": schema_pkg_apis_meta_v1_List(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta": schema_pkg_apis_meta_v1_ListMeta(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.ListOptions": schema_pkg_apis_meta_v1_ListOptions(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.ManagedFieldsEntry": schema_pkg_apis_meta_v1_ManagedFieldsEntry(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.MicroTime": schema_pkg_apis_meta_v1_MicroTime(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta": schema_pkg_apis_meta_v1_ObjectMeta(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.OwnerReference": schema_pkg_apis_meta_v1_OwnerReference(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.PartialObjectMetadata": schema_pkg_apis_meta_v1_PartialObjectMetadata(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.PartialObjectMetadataList": schema_pkg_apis_meta_v1_PartialObjectMetadataList(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.Patch": schema_pkg_apis_meta_v1_Patch(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.PatchOptions": schema_pkg_apis_meta_v1_PatchOptions(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.Preconditions": schema_pkg_apis_meta_v1_Preconditions(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.RootPaths": schema_pkg_apis_meta_v1_RootPaths(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.ServerAddressByClientCIDR": schema_pkg_apis_meta_v1_ServerAddressByClientCIDR(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.Status": schema_pkg_apis_meta_v1_Status(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.StatusCause": schema_pkg_apis_meta_v1_StatusCause(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.StatusDetails": schema_pkg_apis_meta_v1_StatusDetails(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.Table": schema_pkg_apis_meta_v1_Table(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.TableColumnDefinition": schema_pkg_apis_meta_v1_TableColumnDefinition(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.TableOptions": schema_pkg_apis_meta_v1_TableOptions(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.TableRow": schema_pkg_apis_meta_v1_TableRow(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.TableRowCondition": schema_pkg_apis_meta_v1_TableRowCondition(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.Time": schema_pkg_apis_meta_v1_Time(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.Timestamp": schema_pkg_apis_meta_v1_Timestamp(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.TypeMeta": schema_pkg_apis_meta_v1_TypeMeta(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.UpdateOptions": schema_pkg_apis_meta_v1_UpdateOptions(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.WatchEvent": schema_pkg_apis_meta_v1_WatchEvent(ref), - "k8s.io/apimachinery/pkg/version.Info": schema_k8sio_apimachinery_pkg_version_Info(ref), + "github.com/deckhouse/virtualization/api/core/v1alpha3.CPU": schema_virtualization_api_core_v1alpha3_CPU(ref), + "github.com/deckhouse/virtualization/api/core/v1alpha3.CpuDiscovery": schema_virtualization_api_core_v1alpha3_CpuDiscovery(ref), + "github.com/deckhouse/virtualization/api/core/v1alpha3.CpuFeatures": schema_virtualization_api_core_v1alpha3_CpuFeatures(ref), + "github.com/deckhouse/virtualization/api/core/v1alpha3.MemoryMinMax": schema_virtualization_api_core_v1alpha3_MemoryMinMax(ref), + "github.com/deckhouse/virtualization/api/core/v1alpha3.NodeSelector": schema_virtualization_api_core_v1alpha3_NodeSelector(ref), + "github.com/deckhouse/virtualization/api/core/v1alpha3.SizingPolicy": schema_virtualization_api_core_v1alpha3_SizingPolicy(ref), + "github.com/deckhouse/virtualization/api/core/v1alpha3.SizingPolicyCores": schema_virtualization_api_core_v1alpha3_SizingPolicyCores(ref), + "github.com/deckhouse/virtualization/api/core/v1alpha3.SizingPolicyMemory": schema_virtualization_api_core_v1alpha3_SizingPolicyMemory(ref), + "github.com/deckhouse/virtualization/api/core/v1alpha3.SizingPolicyMemoryPerCore": schema_virtualization_api_core_v1alpha3_SizingPolicyMemoryPerCore(ref), + "github.com/deckhouse/virtualization/api/core/v1alpha3.VirtualMachineClass": schema_virtualization_api_core_v1alpha3_VirtualMachineClass(ref), + "github.com/deckhouse/virtualization/api/core/v1alpha3.VirtualMachineClassList": schema_virtualization_api_core_v1alpha3_VirtualMachineClassList(ref), + "github.com/deckhouse/virtualization/api/core/v1alpha3.VirtualMachineClassSpec": schema_virtualization_api_core_v1alpha3_VirtualMachineClassSpec(ref), + "github.com/deckhouse/virtualization/api/core/v1alpha3.VirtualMachineClassStatus": schema_virtualization_api_core_v1alpha3_VirtualMachineClassStatus(ref), + "github.com/deckhouse/virtualization/api/subresources/v1alpha2.VirtualMachine": schema_virtualization_api_subresources_v1alpha2_VirtualMachine(ref), + "github.com/deckhouse/virtualization/api/subresources/v1alpha2.VirtualMachineAddResourceClaim": schema_virtualization_api_subresources_v1alpha2_VirtualMachineAddResourceClaim(ref), + "github.com/deckhouse/virtualization/api/subresources/v1alpha2.VirtualMachineAddVolume": schema_virtualization_api_subresources_v1alpha2_VirtualMachineAddVolume(ref), + "github.com/deckhouse/virtualization/api/subresources/v1alpha2.VirtualMachineCancelEvacuation": schema_virtualization_api_subresources_v1alpha2_VirtualMachineCancelEvacuation(ref), + "github.com/deckhouse/virtualization/api/subresources/v1alpha2.VirtualMachineConsole": schema_virtualization_api_subresources_v1alpha2_VirtualMachineConsole(ref), + "github.com/deckhouse/virtualization/api/subresources/v1alpha2.VirtualMachineFreeze": schema_virtualization_api_subresources_v1alpha2_VirtualMachineFreeze(ref), + "github.com/deckhouse/virtualization/api/subresources/v1alpha2.VirtualMachinePortForward": schema_virtualization_api_subresources_v1alpha2_VirtualMachinePortForward(ref), + "github.com/deckhouse/virtualization/api/subresources/v1alpha2.VirtualMachineRemoveResourceClaim": schema_virtualization_api_subresources_v1alpha2_VirtualMachineRemoveResourceClaim(ref), + "github.com/deckhouse/virtualization/api/subresources/v1alpha2.VirtualMachineRemoveVolume": schema_virtualization_api_subresources_v1alpha2_VirtualMachineRemoveVolume(ref), + "github.com/deckhouse/virtualization/api/subresources/v1alpha2.VirtualMachineUnfreeze": schema_virtualization_api_subresources_v1alpha2_VirtualMachineUnfreeze(ref), + "github.com/deckhouse/virtualization/api/subresources/v1alpha2.VirtualMachineVNC": schema_virtualization_api_subresources_v1alpha2_VirtualMachineVNC(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.APIGroup": schema_pkg_apis_meta_v1_APIGroup(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.APIGroupList": schema_pkg_apis_meta_v1_APIGroupList(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.APIResource": schema_pkg_apis_meta_v1_APIResource(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.APIResourceList": schema_pkg_apis_meta_v1_APIResourceList(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.APIVersions": schema_pkg_apis_meta_v1_APIVersions(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.ApplyOptions": schema_pkg_apis_meta_v1_ApplyOptions(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.Condition": schema_pkg_apis_meta_v1_Condition(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.CreateOptions": schema_pkg_apis_meta_v1_CreateOptions(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.DeleteOptions": schema_pkg_apis_meta_v1_DeleteOptions(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.Duration": schema_pkg_apis_meta_v1_Duration(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.FieldSelectorRequirement": schema_pkg_apis_meta_v1_FieldSelectorRequirement(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.FieldsV1": schema_pkg_apis_meta_v1_FieldsV1(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.GetOptions": schema_pkg_apis_meta_v1_GetOptions(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.GroupKind": schema_pkg_apis_meta_v1_GroupKind(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.GroupResource": schema_pkg_apis_meta_v1_GroupResource(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.GroupVersion": schema_pkg_apis_meta_v1_GroupVersion(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.GroupVersionForDiscovery": schema_pkg_apis_meta_v1_GroupVersionForDiscovery(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.GroupVersionKind": schema_pkg_apis_meta_v1_GroupVersionKind(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.GroupVersionResource": schema_pkg_apis_meta_v1_GroupVersionResource(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.InternalEvent": schema_pkg_apis_meta_v1_InternalEvent(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector": schema_pkg_apis_meta_v1_LabelSelector(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelectorRequirement": schema_pkg_apis_meta_v1_LabelSelectorRequirement(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.List": schema_pkg_apis_meta_v1_List(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta": schema_pkg_apis_meta_v1_ListMeta(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.ListOptions": schema_pkg_apis_meta_v1_ListOptions(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.ManagedFieldsEntry": schema_pkg_apis_meta_v1_ManagedFieldsEntry(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.MicroTime": schema_pkg_apis_meta_v1_MicroTime(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta": schema_pkg_apis_meta_v1_ObjectMeta(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.OwnerReference": schema_pkg_apis_meta_v1_OwnerReference(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.PartialObjectMetadata": schema_pkg_apis_meta_v1_PartialObjectMetadata(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.PartialObjectMetadataList": schema_pkg_apis_meta_v1_PartialObjectMetadataList(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.Patch": schema_pkg_apis_meta_v1_Patch(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.PatchOptions": schema_pkg_apis_meta_v1_PatchOptions(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.Preconditions": schema_pkg_apis_meta_v1_Preconditions(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.RootPaths": schema_pkg_apis_meta_v1_RootPaths(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.ServerAddressByClientCIDR": schema_pkg_apis_meta_v1_ServerAddressByClientCIDR(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.Status": schema_pkg_apis_meta_v1_Status(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.StatusCause": schema_pkg_apis_meta_v1_StatusCause(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.StatusDetails": schema_pkg_apis_meta_v1_StatusDetails(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.Table": schema_pkg_apis_meta_v1_Table(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.TableColumnDefinition": schema_pkg_apis_meta_v1_TableColumnDefinition(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.TableOptions": schema_pkg_apis_meta_v1_TableOptions(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.TableRow": schema_pkg_apis_meta_v1_TableRow(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.TableRowCondition": schema_pkg_apis_meta_v1_TableRowCondition(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.Time": schema_pkg_apis_meta_v1_Time(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.Timestamp": schema_pkg_apis_meta_v1_Timestamp(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.TypeMeta": schema_pkg_apis_meta_v1_TypeMeta(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.UpdateOptions": schema_pkg_apis_meta_v1_UpdateOptions(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.WatchEvent": schema_pkg_apis_meta_v1_WatchEvent(ref), + "k8s.io/apimachinery/pkg/version.Info": schema_k8sio_apimachinery_pkg_version_Info(ref), } } @@ -712,6 +714,68 @@ func schema_virtualization_api_subresources_v1alpha2_VirtualMachine(ref common.R } } +func schema_virtualization_api_subresources_v1alpha2_VirtualMachineAddResourceClaim(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + Type: []string{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + Type: []string{"string"}, + Format: "", + }, + }, + "name": { + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "resourceClaimTemplateName": { + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "requestName": { + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "dryRun": { + SchemaProps: spec.SchemaProps{ + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + }, + Required: []string{"name", "resourceClaimTemplateName", "requestName"}, + }, + }, + } +} + func schema_virtualization_api_subresources_v1alpha2_VirtualMachineAddVolume(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -787,10 +851,18 @@ func schema_virtualization_api_subresources_v1alpha2_VirtualMachineCancelEvacuat SchemaProps: spec.SchemaProps{ Type: []string{"object"}, Properties: map[string]spec.Schema{ - "TypeMeta": { + "kind": { SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.TypeMeta"), + Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + Type: []string{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + Type: []string{"string"}, + Format: "", }, }, "dryRun": { @@ -808,11 +880,8 @@ func schema_virtualization_api_subresources_v1alpha2_VirtualMachineCancelEvacuat }, }, }, - Required: []string{"TypeMeta"}, }, }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.TypeMeta"}, } } @@ -917,6 +986,48 @@ func schema_virtualization_api_subresources_v1alpha2_VirtualMachinePortForward(r } } +func schema_virtualization_api_subresources_v1alpha2_VirtualMachineRemoveResourceClaim(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "TypeMeta": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.TypeMeta"), + }, + }, + "name": { + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "dryRun": { + SchemaProps: spec.SchemaProps{ + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + }, + Required: []string{"TypeMeta", "name"}, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.TypeMeta"}, + } +} + func schema_virtualization_api_subresources_v1alpha2_VirtualMachineRemoveVolume(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ diff --git a/images/virtualization-artifact/pkg/apiserver/api/install.go b/images/virtualization-artifact/pkg/apiserver/api/install.go index 40a5acc6ee..627194b783 100644 --- a/images/virtualization-artifact/pkg/apiserver/api/install.go +++ b/images/virtualization-artifact/pkg/apiserver/api/install.go @@ -27,7 +27,6 @@ import ( vmrest "github.com/deckhouse/virtualization-controller/pkg/apiserver/registry/vm/rest" "github.com/deckhouse/virtualization-controller/pkg/apiserver/registry/vm/storage" "github.com/deckhouse/virtualization-controller/pkg/tls/certmanager" - versionedv1alpha2 "github.com/deckhouse/virtualization/api/client/generated/clientset/versioned/typed/core/v1alpha2" virtlisters "github.com/deckhouse/virtualization/api/client/generated/listers/core/v1alpha2" "github.com/deckhouse/virtualization/api/subresources" "github.com/deckhouse/virtualization/api/subresources/install" @@ -57,15 +56,17 @@ func init() { func Build(store *storage.VirtualMachineStorage) genericapiserver.APIGroupInfo { apiGroupInfo := genericapiserver.NewDefaultAPIGroupInfo(subresources.GroupName, Scheme, ParameterCodec, Codecs) resourcesV1alpha2 := map[string]rest.Storage{ - "virtualmachines": store, - "virtualmachines/console": store.ConsoleREST(), - "virtualmachines/vnc": store.VncREST(), - "virtualmachines/portforward": store.PortForwardREST(), - "virtualmachines/addvolume": store.AddVolumeREST(), - "virtualmachines/removevolume": store.RemoveVolumeREST(), - "virtualmachines/freeze": store.FreezeREST(), - "virtualmachines/unfreeze": store.UnfreezeREST(), - "virtualmachines/cancelevacuation": store.CancelEvacuationREST(), + "virtualmachines": store, + "virtualmachines/console": store.ConsoleREST(), + "virtualmachines/vnc": store.VncREST(), + "virtualmachines/portforward": store.PortForwardREST(), + "virtualmachines/addvolume": store.AddVolumeREST(), + "virtualmachines/removevolume": store.RemoveVolumeREST(), + "virtualmachines/freeze": store.FreezeREST(), + "virtualmachines/unfreeze": store.UnfreezeREST(), + "virtualmachines/cancelevacuation": store.CancelEvacuationREST(), + "virtualmachines/addresourceclaim": store.AddResourceClaimREST(), + "virtualmachines/removeresourceclaim": store.RemoveResourceClaimREST(), } apiGroupInfo.VersionedResourcesStorageMap[subv1alpha2.SchemeGroupVersion.Version] = resourcesV1alpha2 return apiGroupInfo @@ -76,13 +77,11 @@ func Install( server *genericapiserver.GenericAPIServer, kubevirt vmrest.KubevirtAPIServerConfig, proxyCertManager certmanager.CertificateManager, - vmClient versionedv1alpha2.VirtualMachinesGetter, ) error { vmStorage := storage.NewStorage( vmLister, kubevirt, proxyCertManager, - vmClient, ) info := Build(vmStorage) return server.InstallAPIGroup(&info) diff --git a/images/virtualization-artifact/pkg/apiserver/registry/vm/rest/add_resourceclaim.go b/images/virtualization-artifact/pkg/apiserver/registry/vm/rest/add_resourceclaim.go new file mode 100644 index 0000000000..2c2c184682 --- /dev/null +++ b/images/virtualization-artifact/pkg/apiserver/registry/vm/rest/add_resourceclaim.go @@ -0,0 +1,140 @@ +/* +Copyright 2025 Flant JSC + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package rest + +import ( + "context" + "encoding/json" + "fmt" + "net/http" + "net/url" + + corev1 "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apiserver/pkg/registry/rest" + "k8s.io/utils/ptr" + virtv1 "kubevirt.io/api/core/v1" + + "github.com/deckhouse/virtualization-controller/pkg/tls/certmanager" + virtlisters "github.com/deckhouse/virtualization/api/client/generated/listers/core/v1alpha2" + "github.com/deckhouse/virtualization/api/subresources" +) + +type AddResourceClaimREST struct { + *BaseREST +} + +var ( + _ rest.Storage = &AddResourceClaimREST{} + _ rest.Connecter = &AddResourceClaimREST{} +) + +func NewAddResourceClaimREST(baseREST *BaseREST) *AddResourceClaimREST { + return &AddResourceClaimREST{baseREST} +} + +func (r AddResourceClaimREST) New() runtime.Object { + return &subresources.VirtualMachineAddResourceClaim{} +} + +func (r AddResourceClaimREST) Destroy() { +} + +func (r AddResourceClaimREST) Connect(ctx context.Context, name string, opts runtime.Object, responder rest.Responder) (http.Handler, error) { + addResourceClaimOpts, ok := opts.(*subresources.VirtualMachineAddResourceClaim) + if !ok { + return nil, fmt.Errorf("invalid options object: %#v", opts) + } + var ( + resourceClaimPather pather + hooks []mutateRequestHook + ) + + if r.requestFromKubevirt(addResourceClaimOpts) { + resourceClaimPather = newKVVMIPather("addresourceclaim") + } else { + resourceClaimPather = newKVVMPather("addresourceclaim") + h, err := r.genMutateRequestHook(addResourceClaimOpts) + if err != nil { + return nil, err + } + hooks = append(hooks, h) + } + location, transport, err := AddResourceClaimLocation(ctx, r.vmLister, name, addResourceClaimOpts, r.kubevirt, r.proxyCertManager, resourceClaimPather) + if err != nil { + return nil, err + } + handler := newThrottledUpgradeAwareProxyHandler(location, transport, false, responder, r.kubevirt.ServiceAccount, hooks...) + + return handler, nil +} + +// NewConnectOptions implements rest.Connecter interface +func (r AddResourceClaimREST) NewConnectOptions() (runtime.Object, bool, string) { + return &subresources.VirtualMachineAddResourceClaim{}, false, "" +} + +// ConnectMethods implements rest.Connecter interface +func (r AddResourceClaimREST) ConnectMethods() []string { + return []string{http.MethodPut} +} + +func (r AddResourceClaimREST) requestFromKubevirt(opts *subresources.VirtualMachineAddResourceClaim) bool { + return opts == nil || (opts.Name == "" && opts.ResourceClaimTemplateName == "" && opts.RequestName == "") +} + +func (r AddResourceClaimREST) genMutateRequestHook(opts *subresources.VirtualMachineAddResourceClaim) (mutateRequestHook, error) { + hotplugRequest := virtv1.AddResourceClaimOptions{ + Name: opts.Name, + HostDevice: &virtv1.HostDevice{ + Name: opts.Name, + ClaimRequest: &virtv1.ClaimRequest{ + ClaimName: ptr.To(opts.Name), + RequestName: ptr.To(opts.RequestName), + }, + }, + ResourceClaim: &virtv1.ResourceClaim{ + PodResourceClaim: corev1.PodResourceClaim{ + Name: opts.Name, + ResourceClaimTemplateName: ptr.To(opts.ResourceClaimTemplateName), + }, + Hotpluggable: true, + }, + DryRun: opts.DryRun, + } + + newBody, err := json.Marshal(&hotplugRequest) + if err != nil { + return nil, err + } + + return func(req *http.Request) error { + return rewriteBody(req, newBody) + }, nil +} + +func AddResourceClaimLocation( + ctx context.Context, + getter virtlisters.VirtualMachineLister, + name string, + opts *subresources.VirtualMachineAddResourceClaim, + kubevirt KubevirtAPIServerConfig, + proxyCertManager certmanager.CertificateManager, + addResourceClaimPather pather, +) (*url.URL, *http.Transport, error) { + return streamLocation(ctx, getter, name, addResourceClaimPather, kubevirt, proxyCertManager) +} diff --git a/images/virtualization-artifact/pkg/apiserver/registry/vm/rest/add_volume.go b/images/virtualization-artifact/pkg/apiserver/registry/vm/rest/add_volume.go index ae52b6887a..1d72c25345 100644 --- a/images/virtualization-artifact/pkg/apiserver/registry/vm/rest/add_volume.go +++ b/images/virtualization-artifact/pkg/apiserver/registry/vm/rest/add_volume.go @@ -35,9 +35,7 @@ import ( ) type AddVolumeREST struct { - vmLister virtlisters.VirtualMachineLister - proxyCertManager certmanager.CertificateManager - kubevirt KubevirtAPIServerConfig + *BaseREST } var ( @@ -45,12 +43,8 @@ var ( _ rest.Connecter = &AddVolumeREST{} ) -func NewAddVolumeREST(vmLister virtlisters.VirtualMachineLister, kubevirt KubevirtAPIServerConfig, proxyCertManager certmanager.CertificateManager) *AddVolumeREST { - return &AddVolumeREST{ - vmLister: vmLister, - kubevirt: kubevirt, - proxyCertManager: proxyCertManager, - } +func NewAddVolumeREST(baseREST *BaseREST) *AddVolumeREST { + return &AddVolumeREST{baseREST} } func (r AddVolumeREST) New() runtime.Object { @@ -120,7 +114,7 @@ func (r AddVolumeREST) genMutateRequestHook(opts *subresources.VirtualMachineAdd serial = opts.Serial } - hotplugRequest := AddVolumeOptions{ + hotplugRequest := virtv1.AddVolumeOptions{ Name: opts.Name, Disk: &virtv1.Disk{ Name: opts.Name, @@ -134,7 +128,7 @@ func (r AddVolumeREST) genMutateRequestHook(opts *subresources.VirtualMachineAdd if opts.PVCName == "" { return nil, fmt.Errorf("must specify PVCName") } - hotplugRequest.VolumeSource = &HotplugVolumeSource{ + hotplugRequest.VolumeSource = &virtv1.HotplugVolumeSource{ PersistentVolumeClaim: &virtv1.PersistentVolumeClaimVolumeSource{ PersistentVolumeClaimVolumeSource: corev1.PersistentVolumeClaimVolumeSource{ ClaimName: opts.PVCName, @@ -147,7 +141,7 @@ func (r AddVolumeREST) genMutateRequestHook(opts *subresources.VirtualMachineAdd case opts.PVCName != "" && opts.Image != "": return nil, fmt.Errorf("must specify only one of PersistentVolumeClaimName or Image") case opts.PVCName != "": - hotplugRequest.VolumeSource = &HotplugVolumeSource{ + hotplugRequest.VolumeSource = &virtv1.HotplugVolumeSource{ PersistentVolumeClaim: &virtv1.PersistentVolumeClaimVolumeSource{ PersistentVolumeClaimVolumeSource: corev1.PersistentVolumeClaimVolumeSource{ ClaimName: opts.PVCName, @@ -156,8 +150,8 @@ func (r AddVolumeREST) genMutateRequestHook(opts *subresources.VirtualMachineAdd }, } case opts.Image != "": - hotplugRequest.VolumeSource = &HotplugVolumeSource{ - ContainerDisk: &ContainerDiskSource{ + hotplugRequest.VolumeSource = &virtv1.HotplugVolumeSource{ + ContainerDisk: &virtv1.ContainerDiskSource{ Image: opts.Image, Hotpluggable: true, }, @@ -169,8 +163,8 @@ func (r AddVolumeREST) genMutateRequestHook(opts *subresources.VirtualMachineAdd if opts.Image == "" { return nil, fmt.Errorf("must specify Image") } - hotplugRequest.VolumeSource = &HotplugVolumeSource{ - ContainerDisk: &ContainerDiskSource{ + hotplugRequest.VolumeSource = &virtv1.HotplugVolumeSource{ + ContainerDisk: &virtv1.ContainerDiskSource{ Image: opts.Image, Hotpluggable: true, }, @@ -200,28 +194,3 @@ func AddVolumeLocation( ) (*url.URL, *http.Transport, error) { return streamLocation(ctx, getter, name, addVolumePather, kubevirt, proxyCertManager) } - -type VirtualMachineVolumeRequest struct { - AddVolumeOptions *AddVolumeOptions `json:"addVolumeOptions,omitempty" optional:"true"` - RemoveVolumeOptions *virtv1.RemoveVolumeOptions `json:"removeVolumeOptions,omitempty" optional:"true"` -} -type AddVolumeOptions struct { - Name string `json:"name"` - Disk *virtv1.Disk `json:"disk"` - VolumeSource *HotplugVolumeSource `json:"volumeSource"` - DryRun []string `json:"dryRun,omitempty"` -} - -type HotplugVolumeSource struct { - PersistentVolumeClaim *virtv1.PersistentVolumeClaimVolumeSource `json:"persistentVolumeClaim,omitempty"` - DataVolume *virtv1.DataVolumeSource `json:"dataVolume,omitempty"` - ContainerDisk *ContainerDiskSource `json:"containerDisk,omitempty"` -} - -type ContainerDiskSource struct { - Image string `json:"image"` - ImagePullSecret string `json:"imagePullSecret,omitempty"` - Path string `json:"path,omitempty"` - ImagePullPolicy corev1.PullPolicy `json:"imagePullPolicy,omitempty"` - Hotpluggable bool `json:"hotpluggable,omitempty"` -} diff --git a/images/virtualization-artifact/pkg/apiserver/registry/vm/rest/base.go b/images/virtualization-artifact/pkg/apiserver/registry/vm/rest/base.go new file mode 100644 index 0000000000..c1632ddc28 --- /dev/null +++ b/images/virtualization-artifact/pkg/apiserver/registry/vm/rest/base.go @@ -0,0 +1,36 @@ +/* +Copyright 2025 Flant JSC + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package rest + +import ( + "github.com/deckhouse/virtualization-controller/pkg/tls/certmanager" + virtlisters "github.com/deckhouse/virtualization/api/client/generated/listers/core/v1alpha2" +) + +type BaseREST struct { + vmLister virtlisters.VirtualMachineLister + proxyCertManager certmanager.CertificateManager + kubevirt KubevirtAPIServerConfig +} + +func NewBaseREST(vmLister virtlisters.VirtualMachineLister, proxyCertManager certmanager.CertificateManager, kubevirt KubevirtAPIServerConfig) *BaseREST { + return &BaseREST{ + vmLister: vmLister, + proxyCertManager: proxyCertManager, + kubevirt: kubevirt, + } +} diff --git a/images/virtualization-artifact/pkg/apiserver/registry/vm/rest/cancel-evacuation.go b/images/virtualization-artifact/pkg/apiserver/registry/vm/rest/cancel-evacuation.go index c476574368..b9ee401d6d 100644 --- a/images/virtualization-artifact/pkg/apiserver/registry/vm/rest/cancel-evacuation.go +++ b/images/virtualization-artifact/pkg/apiserver/registry/vm/rest/cancel-evacuation.go @@ -33,9 +33,7 @@ import ( ) type CancelEvacuationREST struct { - vmLister virtlisters.VirtualMachineLister - proxyCertManager certmanager.CertificateManager - kubevirt KubevirtAPIServerConfig + *BaseREST } var ( @@ -43,12 +41,8 @@ var ( _ rest.Connecter = &CancelEvacuationREST{} ) -func NewCancelEvacuationREST(vmLister virtlisters.VirtualMachineLister, kubevirt KubevirtAPIServerConfig, proxyCertManager certmanager.CertificateManager) *CancelEvacuationREST { - return &CancelEvacuationREST{ - vmLister: vmLister, - kubevirt: kubevirt, - proxyCertManager: proxyCertManager, - } +func NewCancelEvacuationREST(baseREST *BaseREST) *CancelEvacuationREST { + return &CancelEvacuationREST{baseREST} } func (r CancelEvacuationREST) New() runtime.Object { diff --git a/images/virtualization-artifact/pkg/apiserver/registry/vm/rest/console.go b/images/virtualization-artifact/pkg/apiserver/registry/vm/rest/console.go index 498edbad94..fb97e055b5 100644 --- a/images/virtualization-artifact/pkg/apiserver/registry/vm/rest/console.go +++ b/images/virtualization-artifact/pkg/apiserver/registry/vm/rest/console.go @@ -32,9 +32,7 @@ import ( ) type ConsoleREST struct { - vmLister virtlisters.VirtualMachineLister - proxyCertManager certmanager.CertificateManager - kubevirt KubevirtAPIServerConfig + *BaseREST } type KubevirtAPIServerConfig struct { @@ -48,12 +46,8 @@ var ( _ rest.Connecter = &ConsoleREST{} ) -func NewConsoleREST(vmLister virtlisters.VirtualMachineLister, kubevirt KubevirtAPIServerConfig, proxyCertManager certmanager.CertificateManager) *ConsoleREST { - return &ConsoleREST{ - vmLister: vmLister, - kubevirt: kubevirt, - proxyCertManager: proxyCertManager, - } +func NewConsoleREST(baseREST *BaseREST) *ConsoleREST { + return &ConsoleREST{baseREST} } // New implements rest.Storage interface diff --git a/images/virtualization-artifact/pkg/apiserver/registry/vm/rest/freeze.go b/images/virtualization-artifact/pkg/apiserver/registry/vm/rest/freeze.go index 0529bf5f87..814618ecbd 100644 --- a/images/virtualization-artifact/pkg/apiserver/registry/vm/rest/freeze.go +++ b/images/virtualization-artifact/pkg/apiserver/registry/vm/rest/freeze.go @@ -31,9 +31,7 @@ import ( ) type FreezeREST struct { - vmLister virtlisters.VirtualMachineLister - proxyCertManager certmanager.CertificateManager - kubevirt KubevirtAPIServerConfig + *BaseREST } var ( @@ -41,12 +39,8 @@ var ( _ rest.Connecter = &FreezeREST{} ) -func NewFreezeREST(vmLister virtlisters.VirtualMachineLister, kubevirt KubevirtAPIServerConfig, proxyCertManager certmanager.CertificateManager) *FreezeREST { - return &FreezeREST{ - vmLister: vmLister, - kubevirt: kubevirt, - proxyCertManager: proxyCertManager, - } +func NewFreezeREST(baseREST *BaseREST) *FreezeREST { + return &FreezeREST{baseREST} } func (r FreezeREST) New() runtime.Object { diff --git a/images/virtualization-artifact/pkg/apiserver/registry/vm/rest/portforward.go b/images/virtualization-artifact/pkg/apiserver/registry/vm/rest/portforward.go index cc64f6ece7..52d5d6053d 100644 --- a/images/virtualization-artifact/pkg/apiserver/registry/vm/rest/portforward.go +++ b/images/virtualization-artifact/pkg/apiserver/registry/vm/rest/portforward.go @@ -33,9 +33,7 @@ import ( ) type PortForwardREST struct { - vmLister virtlisters.VirtualMachineLister - proxyCertManager certmanager.CertificateManager - kubevirt KubevirtAPIServerConfig + *BaseREST } var ( @@ -43,12 +41,8 @@ var ( _ rest.Connecter = &PortForwardREST{} ) -func NewPortForwardREST(vmLister virtlisters.VirtualMachineLister, kubevirt KubevirtAPIServerConfig, proxyCertManager certmanager.CertificateManager) *PortForwardREST { - return &PortForwardREST{ - vmLister: vmLister, - kubevirt: kubevirt, - proxyCertManager: proxyCertManager, - } +func NewPortForwardREST(baseREST *BaseREST) *PortForwardREST { + return &PortForwardREST{baseREST} } // New implements rest.Storage interface diff --git a/images/virtualization-artifact/pkg/apiserver/registry/vm/rest/remove_resourceclaim.go b/images/virtualization-artifact/pkg/apiserver/registry/vm/rest/remove_resourceclaim.go new file mode 100644 index 0000000000..fa77d71ef4 --- /dev/null +++ b/images/virtualization-artifact/pkg/apiserver/registry/vm/rest/remove_resourceclaim.go @@ -0,0 +1,124 @@ +/* +Copyright 2025 Flant JSC + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package rest + +import ( + "context" + "encoding/json" + "fmt" + "net/http" + "net/url" + + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apiserver/pkg/registry/rest" + virtv1 "kubevirt.io/api/core/v1" + + "github.com/deckhouse/virtualization-controller/pkg/tls/certmanager" + virtlisters "github.com/deckhouse/virtualization/api/client/generated/listers/core/v1alpha2" + "github.com/deckhouse/virtualization/api/subresources" +) + +type RemoveResourceClaimREST struct { + *BaseREST +} + +var ( + _ rest.Storage = &RemoveResourceClaimREST{} + _ rest.Connecter = &RemoveResourceClaimREST{} +) + +func NewRemoveResourceClaimREST(baseREST *BaseREST) *RemoveResourceClaimREST { + return &RemoveResourceClaimREST{baseREST} +} + +func (r RemoveResourceClaimREST) New() runtime.Object { + return &subresources.VirtualMachineRemoveResourceClaim{} +} + +func (r RemoveResourceClaimREST) Destroy() { +} + +func (r RemoveResourceClaimREST) Connect(ctx context.Context, name string, opts runtime.Object, responder rest.Responder) (http.Handler, error) { + removeResourceClaimOpts, ok := opts.(*subresources.VirtualMachineRemoveResourceClaim) + if !ok { + return nil, fmt.Errorf("invalid options object: %#v", opts) + } + var ( + removeResourceClaimPather pather + hooks []mutateRequestHook + ) + + if r.requestFromKubevirt(removeResourceClaimOpts) { + removeResourceClaimPather = newKVVMIPather("removeresourceclaim") + } else { + removeResourceClaimPather = newKVVMPather("removeresourceclaim") + h, err := r.genMutateRequestHook(removeResourceClaimOpts) + if err != nil { + return nil, err + } + hooks = append(hooks, h) + } + + location, transport, err := RemoveResourceClaimRESTLocation(ctx, r.vmLister, name, removeResourceClaimOpts, r.kubevirt, r.proxyCertManager, removeResourceClaimPather) + if err != nil { + return nil, err + } + handler := newThrottledUpgradeAwareProxyHandler(location, transport, false, responder, r.kubevirt.ServiceAccount, hooks...) + return handler, nil +} + +// NewConnectOptions implements rest.Connecter interface +func (r RemoveResourceClaimREST) NewConnectOptions() (runtime.Object, bool, string) { + return &subresources.VirtualMachineRemoveResourceClaim{}, false, "" +} + +// ConnectMethods implements rest.Connecter interface +func (r RemoveResourceClaimREST) ConnectMethods() []string { + return []string{http.MethodPut} +} + +func (r RemoveResourceClaimREST) requestFromKubevirt(opts *subresources.VirtualMachineRemoveResourceClaim) bool { + return opts == nil || opts.Name == "" +} + +func (r RemoveResourceClaimREST) genMutateRequestHook(opts *subresources.VirtualMachineRemoveResourceClaim) (mutateRequestHook, error) { + unplugRequest := virtv1.RemoveResourceClaimOptions{ + Name: opts.Name, + DryRun: opts.DryRun, + } + + newBody, err := json.Marshal(&unplugRequest) + if err != nil { + return nil, err + } + + return func(req *http.Request) error { + return rewriteBody(req, newBody) + }, nil +} + +func RemoveResourceClaimRESTLocation( + ctx context.Context, + getter virtlisters.VirtualMachineLister, + name string, + opts *subresources.VirtualMachineRemoveResourceClaim, + kubevirt KubevirtAPIServerConfig, + proxyCertManager certmanager.CertificateManager, + removeResourceClaimPather pather, +) (*url.URL, *http.Transport, error) { + return streamLocation(ctx, getter, name, removeResourceClaimPather, kubevirt, proxyCertManager) +} diff --git a/images/virtualization-artifact/pkg/apiserver/registry/vm/rest/remove_volume.go b/images/virtualization-artifact/pkg/apiserver/registry/vm/rest/remove_volume.go index 9792d51f1a..e2eacbd017 100644 --- a/images/virtualization-artifact/pkg/apiserver/registry/vm/rest/remove_volume.go +++ b/images/virtualization-artifact/pkg/apiserver/registry/vm/rest/remove_volume.go @@ -33,9 +33,7 @@ import ( ) type RemoveVolumeREST struct { - vmLister virtlisters.VirtualMachineLister - proxyCertManager certmanager.CertificateManager - kubevirt KubevirtAPIServerConfig + *BaseREST } var ( @@ -43,12 +41,8 @@ var ( _ rest.Connecter = &RemoveVolumeREST{} ) -func NewRemoveVolumeREST(vmLister virtlisters.VirtualMachineLister, kubevirt KubevirtAPIServerConfig, proxyCertManager certmanager.CertificateManager) *RemoveVolumeREST { - return &RemoveVolumeREST{ - vmLister: vmLister, - kubevirt: kubevirt, - proxyCertManager: proxyCertManager, - } +func NewRemoveVolumeREST(baseREST *BaseREST) *RemoveVolumeREST { + return &RemoveVolumeREST{baseREST} } func (r RemoveVolumeREST) New() runtime.Object { diff --git a/images/virtualization-artifact/pkg/apiserver/registry/vm/rest/unfreeze.go b/images/virtualization-artifact/pkg/apiserver/registry/vm/rest/unfreeze.go index 772014d807..a27dd21cb2 100644 --- a/images/virtualization-artifact/pkg/apiserver/registry/vm/rest/unfreeze.go +++ b/images/virtualization-artifact/pkg/apiserver/registry/vm/rest/unfreeze.go @@ -31,9 +31,7 @@ import ( ) type UnfreezeREST struct { - vmLister virtlisters.VirtualMachineLister - proxyCertManager certmanager.CertificateManager - kubevirt KubevirtAPIServerConfig + *BaseREST } var ( @@ -41,12 +39,8 @@ var ( _ rest.Connecter = &UnfreezeREST{} ) -func NewUnfreezeREST(vmLister virtlisters.VirtualMachineLister, kubevirt KubevirtAPIServerConfig, proxyCertManager certmanager.CertificateManager) *UnfreezeREST { - return &UnfreezeREST{ - vmLister: vmLister, - kubevirt: kubevirt, - proxyCertManager: proxyCertManager, - } +func NewUnfreezeREST(baseREST *BaseREST) *UnfreezeREST { + return &UnfreezeREST{baseREST} } func (r UnfreezeREST) New() runtime.Object { diff --git a/images/virtualization-artifact/pkg/apiserver/registry/vm/rest/vnc.go b/images/virtualization-artifact/pkg/apiserver/registry/vm/rest/vnc.go index 7d6f4d03e6..a1e63b606c 100644 --- a/images/virtualization-artifact/pkg/apiserver/registry/vm/rest/vnc.go +++ b/images/virtualization-artifact/pkg/apiserver/registry/vm/rest/vnc.go @@ -31,9 +31,7 @@ import ( ) type VNCREST struct { - vmLister virtlisters.VirtualMachineLister - proxyCertManager certmanager.CertificateManager - kubevirt KubevirtAPIServerConfig + *BaseREST } var ( @@ -41,12 +39,8 @@ var ( _ rest.Connecter = &VNCREST{} ) -func NewVNCREST(vmLister virtlisters.VirtualMachineLister, kubevirt KubevirtAPIServerConfig, proxyCertManager certmanager.CertificateManager) *VNCREST { - return &VNCREST{ - vmLister: vmLister, - kubevirt: kubevirt, - proxyCertManager: proxyCertManager, - } +func NewVNCREST(baseREST *BaseREST) *VNCREST { + return &VNCREST{baseREST} } // New implements rest.Storage interface diff --git a/images/virtualization-artifact/pkg/apiserver/registry/vm/storage/storage.go b/images/virtualization-artifact/pkg/apiserver/registry/vm/storage/storage.go index d024fbb9e3..ff5a903e32 100644 --- a/images/virtualization-artifact/pkg/apiserver/registry/vm/storage/storage.go +++ b/images/virtualization-artifact/pkg/apiserver/registry/vm/storage/storage.go @@ -27,23 +27,23 @@ import ( vmrest "github.com/deckhouse/virtualization-controller/pkg/apiserver/registry/vm/rest" "github.com/deckhouse/virtualization-controller/pkg/tls/certmanager" - versionedv1alpha2 "github.com/deckhouse/virtualization/api/client/generated/clientset/versioned/typed/core/v1alpha2" virtlisters "github.com/deckhouse/virtualization/api/client/generated/listers/core/v1alpha2" "github.com/deckhouse/virtualization/api/subresources" subv1alpha2 "github.com/deckhouse/virtualization/api/subresources/v1alpha2" ) type VirtualMachineStorage struct { - vmLister virtlisters.VirtualMachineLister - console *vmrest.ConsoleREST - vnc *vmrest.VNCREST - portforward *vmrest.PortForwardREST - addVolume *vmrest.AddVolumeREST - removeVolume *vmrest.RemoveVolumeREST - freeze *vmrest.FreezeREST - unfreeze *vmrest.UnfreezeREST - cancelEvacuation *vmrest.CancelEvacuationREST - vmClient versionedv1alpha2.VirtualMachinesGetter + vmLister virtlisters.VirtualMachineLister + console *vmrest.ConsoleREST + vnc *vmrest.VNCREST + portforward *vmrest.PortForwardREST + addVolume *vmrest.AddVolumeREST + removeVolume *vmrest.RemoveVolumeREST + freeze *vmrest.FreezeREST + unfreeze *vmrest.UnfreezeREST + cancelEvacuation *vmrest.CancelEvacuationREST + addResourceClaim *vmrest.AddResourceClaimREST + removeResourceClaim *vmrest.RemoveResourceClaimREST } var ( @@ -58,19 +58,20 @@ func NewStorage( vmLister virtlisters.VirtualMachineLister, kubevirt vmrest.KubevirtAPIServerConfig, proxyCertManager certmanager.CertificateManager, - vmClient versionedv1alpha2.VirtualMachinesGetter, ) *VirtualMachineStorage { + baseRest := vmrest.NewBaseREST(vmLister, proxyCertManager, kubevirt) return &VirtualMachineStorage{ - vmLister: vmLister, - console: vmrest.NewConsoleREST(vmLister, kubevirt, proxyCertManager), - vnc: vmrest.NewVNCREST(vmLister, kubevirt, proxyCertManager), - portforward: vmrest.NewPortForwardREST(vmLister, kubevirt, proxyCertManager), - addVolume: vmrest.NewAddVolumeREST(vmLister, kubevirt, proxyCertManager), - removeVolume: vmrest.NewRemoveVolumeREST(vmLister, kubevirt, proxyCertManager), - freeze: vmrest.NewFreezeREST(vmLister, kubevirt, proxyCertManager), - unfreeze: vmrest.NewUnfreezeREST(vmLister, kubevirt, proxyCertManager), - cancelEvacuation: vmrest.NewCancelEvacuationREST(vmLister, kubevirt, proxyCertManager), - vmClient: vmClient, + vmLister: vmLister, + console: vmrest.NewConsoleREST(baseRest), + vnc: vmrest.NewVNCREST(baseRest), + portforward: vmrest.NewPortForwardREST(baseRest), + addVolume: vmrest.NewAddVolumeREST(baseRest), + removeVolume: vmrest.NewRemoveVolumeREST(baseRest), + freeze: vmrest.NewFreezeREST(baseRest), + unfreeze: vmrest.NewUnfreezeREST(baseRest), + cancelEvacuation: vmrest.NewCancelEvacuationREST(baseRest), + addResourceClaim: vmrest.NewAddResourceClaimREST(baseRest), + removeResourceClaim: vmrest.NewRemoveResourceClaimREST(baseRest), } } @@ -106,6 +107,14 @@ func (store VirtualMachineStorage) CancelEvacuationREST() *vmrest.CancelEvacuati return store.cancelEvacuation } +func (store VirtualMachineStorage) AddResourceClaimREST() *vmrest.AddResourceClaimREST { + return store.addResourceClaim +} + +func (store VirtualMachineStorage) RemoveResourceClaimREST() *vmrest.RemoveResourceClaimREST { + return store.removeResourceClaim +} + // New implements rest.Storage interface func (store VirtualMachineStorage) New() runtime.Object { return &subv1alpha2.VirtualMachine{} diff --git a/images/virtualization-artifact/pkg/apiserver/server/config.go b/images/virtualization-artifact/pkg/apiserver/server/config.go index 1215aec0fe..291dc99643 100644 --- a/images/virtualization-artifact/pkg/apiserver/server/config.go +++ b/images/virtualization-artifact/pkg/apiserver/server/config.go @@ -26,7 +26,6 @@ import ( "github.com/deckhouse/virtualization-controller/pkg/apiserver/api" vmrest "github.com/deckhouse/virtualization-controller/pkg/apiserver/registry/vm/rest" "github.com/deckhouse/virtualization-controller/pkg/tls/certmanager/filesystem" - virtclient "github.com/deckhouse/virtualization/api/client/generated/clientset/versioned" ) var ErrConfigInvalid = errors.New("configuration is invalid") @@ -81,16 +80,10 @@ func (c Config) Complete() (*Server, error) { return nil, err } - virtClient, err := virtclient.NewForConfig(c.Rest) - if err != nil { - return nil, err - } - err = api.Install(vmInformer.Lister(), genericServer, c.Kubevirt, proxyCertManager, - virtClient.VirtualizationV1alpha2(), ) if err != nil { return nil, err diff --git a/images/virtualization-artifact/pkg/logger/options.go b/images/virtualization-artifact/pkg/logger/options.go index 8199b01609..a6f6f52673 100644 --- a/images/virtualization-artifact/pkg/logger/options.go +++ b/images/virtualization-artifact/pkg/logger/options.go @@ -17,8 +17,9 @@ limitations under the License. package logger import ( - "github.com/deckhouse/deckhouse/pkg/log" "github.com/spf13/pflag" + + "github.com/deckhouse/deckhouse/pkg/log" ) type Options struct { diff --git a/templates/kubevirt/kubevirt.yaml b/templates/kubevirt/kubevirt.yaml index 8f8a4bc839..670f4b59f7 100644 --- a/templates/kubevirt/kubevirt.yaml +++ b/templates/kubevirt/kubevirt.yaml @@ -64,6 +64,7 @@ spec: - VolumesUpdateStrategy - HostDevicesWithDRA - HostDevices + - HotplugHostDevicesWithDRA # custom virtualMachineOptions: disableSerialConsoleLog: {} customizeComponents: diff --git a/templates/kubevirt/virt-operator/rbac-for-us.yaml b/templates/kubevirt/virt-operator/rbac-for-us.yaml index 91a6311478..c3c7b0119a 100644 --- a/templates/kubevirt/virt-operator/rbac-for-us.yaml +++ b/templates/kubevirt/virt-operator/rbac-for-us.yaml @@ -591,6 +591,8 @@ rules: resources: - virtualmachines/addvolume - virtualmachines/removevolume + - virtualmachines/addresourceclaim + - virtualmachines/removeresourceclaim verbs: - update - apiGroups: @@ -598,6 +600,8 @@ rules: resources: - virtualmachineinstances/addvolume - virtualmachineinstances/removevolume + - virtualmachineinstances/addresourceclaim + - virtualmachineinstances/removeresourceclaim - virtualmachineinstances/freeze - virtualmachineinstances/unfreeze - virtualmachineinstances/softreboot @@ -848,6 +852,8 @@ rules: - virtualmachineinstances/unpause - virtualmachineinstances/addvolume - virtualmachineinstances/removevolume + - virtualmachineinstances/addresourceclaim + - virtualmachineinstances/removeresourceclaim - virtualmachineinstances/freeze - virtualmachineinstances/unfreeze - virtualmachineinstances/softreboot @@ -871,6 +877,8 @@ rules: - virtualmachines/restart - virtualmachines/addvolume - virtualmachines/removevolume + - virtualmachines/addresourceclaim + - virtualmachines/removeresourceclaim - virtualmachines/migrate - virtualmachines/memorydump - virtualmachines/addinterface @@ -998,6 +1006,8 @@ rules: - virtualmachineinstances/unpause - virtualmachineinstances/addvolume - virtualmachineinstances/removevolume + - virtualmachineinstances/addresourceclaim + - virtualmachineinstances/removeresourceclaim - virtualmachineinstances/freeze - virtualmachineinstances/unfreeze - virtualmachineinstances/softreboot @@ -1020,6 +1030,8 @@ rules: - virtualmachines/restart - virtualmachines/addvolume - virtualmachines/removevolume + - virtualmachines/addresourceclaim + - virtualmachines/removeresourceclaim - virtualmachines/migrate - virtualmachines/memorydump - virtualmachines/addinterface diff --git a/templates/virtualization-api/rbac-for-us.yaml b/templates/virtualization-api/rbac-for-us.yaml index cf8c0c7515..47d95e595f 100644 --- a/templates/virtualization-api/rbac-for-us.yaml +++ b/templates/virtualization-api/rbac-for-us.yaml @@ -9,6 +9,7 @@ metadata: imagePullSecrets: - name: virtualization-module-registry --- +# TODO: add addresourceclaim and removeresourceclaim permissions after rebase to main apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: